serpro/Android-PHP-Encrypt-Decrypt

How to Encrypt UTF-8 Charset

Opened this issue · 1 comments

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

Thank You Mr.Serpro

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()); }