Thanks & Regards
KITTU
Soumyajit Hazra wrote:Giving you a very basic example of encode and decode a string using AES. .
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Java Programmer | SCJP 1.5 | SCWCD 1.4
Soumyajit Hazra wrote:I appreciate your thorough analysis of the code James.But regarding point 2 I must say it's a mere example not a production code and when we have to write code related to security it's like commonsense that not to put any such string hard coded in the source code. I'll keep in mind all of your point what you have suggested for betterment of the code.And I clearly mentioned this code is encoding a string not a file. It's only to give a idea because often after seeing a code only we understand what exactly we need to achieve.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Java Programmer | SCJP 1.5 | SCWCD 1.4
Soumyajit Hazra wrote:I am completely agreed with you James. I will keep in mind your advise from next time.Please provide some links where it give some proper idea about file encryption. I searched in google but most of the example are with strings only not for entire file.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
James Sabre wrote:3) The obvious implementation flaw is that the platform default character encoding is being used to turn the cleartext String into bytes. The default character encoding may not be able to completely represent all the characters in the String and it depends on the platform, locale and Java version being used. This means the the resultant ciphertext file may not be decipherable on some computers.
Thanks & Regards
KITTU
Don't get me started about those stupid light bulbs. |