java - How to encrypt/decrypt multiple strings in AES encryption? -


i know if encrypt 2 or more strings in aes encryption. let's say, want encrypt username, password , nonce_value. can use following code?

try {     string codeword = username, password, nonceinstring;     string encrypteddata = aseencryptdecrypt.encrypt(codeword);     string decrypteddata = aseencryptdecrypt.decrypt(encrypteddata);      system.out.println("encrypted : " + encrypteddata);     system.out.println("decrypted : " + decrypteddata); } catch (throwable e) {     e.printstacktrace(); } 

well work? why not try code , see? in theory can put multiple pieces of data 1 string , encrypt string, though you'd want better way of putting data together. current code, commas between username, password, , nonceinstring won't compile, if can prevent, instance, colon existing in of strings, like:

string codeword = username+":"+password+":"+nonceinstring; 

and when decode split on colon.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -