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

How to Encrypt UTF-8 Charset #11

Open
MansoorJafari opened this issue Dec 13, 2015 · 1 comment
Open

How to Encrypt UTF-8 Charset #11

MansoorJafari opened this issue Dec 13, 2015 · 1 comment
Assignees
Labels

Comments

@MansoorJafari
Copy link

Hi
How to Encrypt utf-8 Charset?(Persian-arabic)

Thank You Mr.Serpro

@serpro serpro self-assigned this Jan 13, 2016
@farsroidx
Copy link

Hi
How to Encrypt utf-8 Charset?(Persian-arabic)

Thank You Mr.Serpro

Hi, Transfer your code with this code...

constructor:
ivspec = new IvParameterSpec(iv.getBytes(kotlin.text.Charsets.UTF_8)); keyspec = new SecretKeySpec(SecretKey.getBytes(kotlin.text.Charsets.UTF_8), "AES");

encrypt method:
try { cipher.init(Cipher.ENCRYPT_MODE, keyspec, ivspec); encrypted = cipher.doFinal(padString(text).getBytes(Charsets.UTF_8)); } catch (Exception e) { throw new RuntimeException("[encrypt] " + e.getMessage()); }

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

No branches or pull requests

3 participants