Implement sanity check in example program

This commit is contained in:
2025-05-03 20:05:02 -04:00
parent baad84563e
commit ec358c6d0c
3 changed files with 22 additions and 4 deletions
+3 -2
View File
@@ -8,8 +8,9 @@ import (
// GenSanityCheck creates an encrypted file containing known plaintext
// to later be used for ensuring the user does not encrypt data with
// an incorrect passphrase.
func GenSanityCheck(path string, passphrase []byte) {
os.WriteFile(path, Encrypt([]byte("thx4usin'rcw"), passphrase), 0600)
func GenSanityCheck(path string, passphrase []byte) error {
err := os.WriteFile(path, Encrypt([]byte("thx4usin'rcw"), passphrase), 0600)
return err
}
// RunSanityCheck should be run before any encryption operation