我尝试使用以下代码对纯文本进行加密。该代码似乎对文本进行了加密,但是并没有将其解密为纯文本。我究竟做错了什么 ?
代码:
Entity entity = new Entity("password");
byte[] ciphertext = crypto.encrypt(("data to encrypt").getBytes(),entity);
plaintext = crypto.decrypt(ciphertext,entity)
Run Code Online (Sandbox Code Playgroud)
输出:
Ecrypted text:[B@417a110
Decrypted text:[B@417df20
Run Code Online (Sandbox Code Playgroud) 我正在使用android应用程序,我需要将视频保存在SD卡中,并且不能将其传输,这就是为什么我在需要时进行加密和解密的原因Facebook Conceal,如果视频尺寸较小,则可以很好地工作。
每当我尝试对大型视频文件进行加密和解密10MB时GenyMotion running 2.3.7,崩溃不止于此,OutOfMemoryException这意味着我分配给我的应用程序的堆内存用光了,这是无法处理的,但必须防止。
尝试过:
Facebook隐藏:在解密时说
You must read the entire stream to completion.
The verification is done at the end of the stream.
Thus not reading till the end of the stream will cause
a security bug. For safety, you should not
use any of the data until it's been fully read or throw
away the data if an exception occurs.
Run Code Online (Sandbox Code Playgroud)
我正在使用以下代码进行加密和解密Facebook Conceal: …