我正在阅读有关加密的内容,并且很难理解加密程序的这 3 个 Java 语句。
cipher = Cipher.getInstance("AES");
cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
encrypted = cipher.doFinal(str.getBytes())
有人可以帮忙吗?
最佳答案
简单来说,
- create a new Encrypting Device using the AES algorithm;
- make it ready
- get the bytes of the string
str
and encrypt them; return the result into theencrypted
object, whatever that is.
你到底不明白什么?
关于java - 我看不懂的加密代码段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1913244/