java - How can I save the DES encrypted string correctly? -


i'm using des encrypt string s1. after s1 encrypted byte[] b1, want save string s2. when try turn s2 byte[] b2 , decrypt original string s1, error occurs:

javax.crypto.illegalblocksizeexception: input length must multiple of 8 when decrypting padded cipher

ciphertest ct = new ciphertest(); byte[] encoded = ct.encrypt(str, key); string s1 = new string(encoded); byte[] b1 = s1.getbytes(); string decoded=ct.decrypt(b1, key); 


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -