+is_good_magic (const struct encrypted_file *f)
+{
+ char plaintext[16];
+ rijndaelDecrypt (f->rk, f->Nr, CHAR_CAST (const char *, f->ciphertext),
+ plaintext);
+
+ const struct substring magic[] = {
+ ss_cstr ("$FL2@(#)"),
+ ss_cstr ("$FL3@(#)"),
+ ss_cstr ("* Encoding"),
+ ss_buffer ("PK\3\4\x14\0\x8", 7)
+ };
+ for (size_t i = 0; i < sizeof magic / sizeof *magic; i++)
+ if (ss_equals (ss_buffer (plaintext, magic[i].length), magic[i]))
+ return true;
+ return false;
+}
+
+/* Attempts to use plaintext password PASSWORD to unlock F. Returns true if
+ successful, otherwise false. */
+bool
+encrypted_file_unlock__ (struct encrypted_file *f, const char *password)