Typo, should be *Cipher *cipher = Cipher.getInstance("AES"); /Andy

On Saturday, 1 December 2018 08:17:16 UTC+8, Andy Ng wrote:
>
> Hi Jonathan,
>
> Great! So this issue is not only applicable to me, I think this means it 
> is time for a PR.
>
> Jonathan, when you ran more test on Monday, you can see if the following 
> can fix this bug:
>
> Overlay the BaseBinaryCipherExecutor class, and change the encode and 
> decode to the following:
>
> @Override
> @SneakyThrows
> public byte[] encode(final byte[] value, final Object[] parameters) { cipher 
> = Cipher.getInstance("AES");
> cipher.init(Cipher.ENCRYPT_MODE, this.encryptionKey);
> final byte[] result = cipher.doFinal(value);
> return sign(result);
> }
> @Override
> @SneakyThrows
> public byte[] decode(final byte[] value, final Object[] parameters) { cipher 
> = Cipher.getInstance("AES");
> final byte[] verifiedValue = verifySignature(value);
> cipher.init(Cipher.DECRYPT_MODE, this.encryptionKey);
> final byte[] bytePlainText = cipher.doFinal(verifiedValue);
> return bytePlainText;
> }
> *Note: If you have trouble doing the above, this tutorial should 
> help: https://apereo.github.io/2018/04/01/cas-overlays-supercharged/ 
> <https://apereo.github.io/2018/04/01/cas-overlays-supercharged/>*
>
> If you problem is the same as mine, the BadPaddingException Exception 
> should goes away after the fix.
>
> Cheers!
> - Andy
>
>
>
>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/8dd1c51e-d628-4e6f-ae0d-03bc21900f03%40apereo.org.

Reply via email to