LoginLogin

Using a SHA value as a key for encryption

Root / General / [.]

DevinF06Created:
Using a file's own SHA value is great for a encryption key because:
  • It is a very good password
  • You can check if the password is incorrect
  • The data/checking is two sided
LINPUT "Password:"; PASSWORD$

'Insert decryption stuff here

IF SHA(PRG$) != PASSWORD$ THEN
 PRINT "Incorrect password!"
ENDIF
Here's a relatively simple image about the idea:

Use a checksum to verify integrity after decryption.