how to display the decrypted and splited Strings in order?

Posted by sebby_zml on Stack Overflow See other posts from Stack Overflow or by sebby_zml
Published on 2010-04-29T07:19:21Z Indexed on 2010/04/29 7:27 UTC
Read the original article Hit count: 470

Hi everyone,

i need some help and guidance in displaying the splitted Strings in order.

let say, i have username, password, nonceInString. i had successfully encrypted and decrypted those. then i split the decrypted data. it was done, too.

i want to display the decrypted data in order. something like this.

userneme: sebastian
password: harrypotter
nonce value: sdgvay1saq3qsd5vc6dger9wqktue2tz*

i tried the following code, but it didn't display like i wish to.
pls help. thanks a lot in advance.

String codeWord = username + ";" + password + ";" + nonceInString;
String encryptedData = aesEncryptDecrypt.encrypt(codeWord);
String decryptedData = aesEncryptDecrypt.decrypt(encryptedData);
String[] splits = decryptedData.split(";");
String[] variables = {"username", "password", "nonce value"};
for (String data : variables){
    for (String item : splits){
        System.out.println( data + ": "+ item);
    }
}

© Stack Overflow or respective owner

Related posts about split

Related posts about java