Hi,

My web application was initially running on tomcat 7.0.53 and I
use org.apache.commons.codec.binary.Base64 for encryption and decryption.

Now the server has been updated to tomcat 7.0.57 and I get a java
Nullpointer error at c.doFinal line:

    public static String make(String Data) throws Exception {
    byte[] encodedCommons;
        Key key = generateMakeKey();
        Cipher c = Cipher.getInstance(ALGO);
        c.init(Cipher.ENCRYPT_MODE, key);
       * byte[] encVal = c.doFinal(Data.getBytes());*
        encodedCommons = Base64.encodeBase64(encVal);
        String encryptedValue = new String(encodedCommons);
        //BASE64Encoder benc = new BASE64Encoder();
        //String encryptedValue = benc.encode(encVal);
        return encryptedValue;
    }

Is the problem because I need to be using something other than the
org.apache.commons.codec.binary.Base64?

Please advise.

Regards.
Prathyusha

Reply via email to