How to encrypt/decrypt a file in Java?

前端 未结 6 1500
滥情空心
滥情空心 2021-01-16 09:07

I am writing a Java application which can \"encrypt\" and consequently \"decrypt\" whatever binary file.

I am just a beginner in the \"cryptography\" area so I would

6条回答
  •  被撕碎了的回忆
    2021-01-16 09:48

    It would probably be easier not to check the password give by the user against a global password, rather ensure that only that one password (known by the user) decrypts the ciphertext into the correct plaintext, any other password would return gibberish. This is usually how cryptography works and means you don't have to store a centralised password anywhere.

提交回复
热议问题