Hi all,
I have made an PR about this issue, it can be seen
here: https://github.com/apereo/cas/pull/3679
Cheers!
- Andy
On Saturday, 1 December 2018 08:18:43 UTC+8, Andy Ng wrote:
>
> 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/7ddad275-669e-4bd2-b1ba-f9fdd8a69385%40apereo.org.