Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't encrypt unicode string - Java #6

Open
langhoangal opened this issue Mar 19, 2014 · 3 comments
Open

Can't encrypt unicode string - Java #6

langhoangal opened this issue Mar 19, 2014 · 3 comments

Comments

@langhoangal
Copy link

Hi,

I have try to use your code to encrypt utf8 string but got an errr: javax.crypto.IllegalBlockSizeException: data not block size aligned.

Could you help to fix, please?

@serpro
Copy link
Owner

serpro commented Mar 19, 2014

Hello,
Does it happen every time you try or with an specific string?

@langhoangal
Copy link
Author

Hi,

It happen anytime i try to encrypt the utf8 string.
For ex, you can try to encrypt some english phonetic: ˌdef.ɪˈnɪʃ.ən, helˈəʊ

"javax.crypto.IllegalBlockSizeException: data not block size aligned.
at com.android.org.bouncycastle.jce.provider.JCEBlockCipher.engineDoFinal(JCEBlockCipher.java:697)"

Many thanks.

@serpro serpro added bug and removed bug labels Aug 13, 2014
@ShalevApps
Copy link

Same here, I tried all sorts of ASCII type strings, and they all work. As soon as I type in one UTF-8 character, I get ----------java.lang.Exception: [encrypt] error:0607F08A:digital envelope routines:EVP_EncryptFinal_ex:data not multiple of block length ------------
(I must use UTF-8 as my customers speak Hebrew). I am completely flustered and would greatly appreciate it if you had some insight as to how to make it work with UTF-8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants