diff --git a/src/storage.rs b/src/storage.rs index 37366ee..2a0101d 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -109,6 +109,7 @@ impl Storage { match line { Ok(line) => { if id.is_none() { + let line = encoder.decrypt(line)?; id = Some(line); } else { let content = encoder.decrypt(line)?; @@ -192,7 +193,7 @@ impl Storage { writeln!(file, "{}", self.encoder.get_encoded_test_passphrase()?)?; for item in self.items.iter() { - writeln!(file, "{}", item.id)?; + writeln!(file, "{}", self.encoder.encrypt(&item.id)?)?; let content = self.encoder.encrypt(&item.content)?; writeln!(file, "{}", content)?; }