Android Cipher encrypt/decrypt

后端 未结 2 1932
忘了有多久
忘了有多久 2020-12-25 08:54

I\'m using cipher to encrypt and decrypt messages:

public String encrypt(String string) throws InvalidKeyException, IllegalBlockSizeException, BadPaddingExce         


        
2条回答
  •  一个人的身影
    2020-12-25 09:40

    You need to convert Base-64 first.

    CODEED = encrypt(Base64.encode(MYSTRING, Base64.DEFAULT));

    MYSTRING = Base64.decode(decrypt(CODEED), Base64.DEFAULT);

    here is a link http://androidcodemonkey.blogspot.com/2010/03/how-to-base64-encode-decode-android.html

提交回复
热议问题