Java: Javax Cipher class默认设置的是哪种模式?

Java: Which mode is by default set in Javax Cipher class?

我正在努力保护一个用Java编写的聊天应用程序(它是从互联网上下载的,现在我想保护它以便学习)。我在发帖之前已经阅读了 documentation, but I am unable to figure out which mode of encryption is set by default, if I don't explicitly put one. Is it ECB? If so, what's the key differences between it and other modes of encryption in regards of a chat application? It's worth mentioning that I watched this explanation,因为我仍然无法找到问题的答案。

我encrypted/decrypted发送消息的方式是:

我会说这是欧洲央行。

希望有人能帮我解释一下!

在您链接的文档中,有一个示例:Cipher c = Cipher.getInstance("AES/CBC/PKCS5Padding") 它使用 CBC 模式。同一文档将 ECB 列为 AES 的有效模式。

你必须自己拼出模式。