java - Miffed... Simple Code, but ... org.jasypt.exceptions.EncryptionOperationNotPossibleException -


i have used code or similar time , again within server code on web apps, trying make command line utility work maintenance backend.

keep on getting encryptionoperationnotpossibleexception, can't see i'm doing wrong in code. test snippet i've used real encrypted string make sure it's not test input.

anybody out there see in code exception come from?

import org.jasypt.exceptions.encryptionoperationnotpossibleexception; import org.jasypt.util.text.basictextencryptor;  public class decipher {      /**      * @param args      */     public static void main(string[] args) {         if (args[0] != null) {             string encstr = args[0];             string decstr = "";              if (encstr != null && !encstr.equals("")) {                 try {                     basictextencryptor textencryptor = new basictextencryptor();                     textencryptor.setpassword("1234566789");                     decstr = textencryptor.decrypt(encstr);                     system.out.println(decstr);                 } catch (encryptionoperationnotpossibleexception e) {                     system.out.println(e.tostring());                 }             } else {                 system.out.println("passed empty string... not decrypted.");             }         } else {             system.out.println("this program requires , encrypted text input.");         }     } } 

fixed!! turns out input string using not valid encrypted string in first place!! first run script encrypt, copy , past string, run decrypt against string...


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

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