Skip to main content
3 of 3
Clarified purpose in title; edit tags (this has nothing to do with filesystems)
Luc
  • 33.1k
  • 8
  • 81
  • 140

How to check that the user entered the correct password when decrypting a file?

I'm trying to create a program for encrypting/decrypting different files. I have not problems with the code, I just don't know how to save the password for every file, which was encrypted through my program.

A user can encrypt his file using a password, and when he tries to decrypt it, there must be a message which informs him about the incorrect password, because, when he uses an incorrect password, the program will produce a decrypted file, which will still be unreadable.