---
title: "Comment by Mike Dabydeen on \"The delete that didn't delete\" | Hashnode"
description: "Rotating the key only makes the purged blocks unreadable once the old key is destroyed, and since Foxstash never holds the key, that last step sits with the app"
url: "https://hashnode.com/posts/the-delete-that-didnt-delete/6ad508739ca15024b6915def/comment/6ad5fe3bfcadb3d65fdf9d9b"
---

[Discussion](https://hashnode.com/posts/the-delete-that-didnt-delete/6ad508739ca15024b6915def)

Comment [The delete that didn't delete](https://hashnode.com/posts/the-delete-that-didnt-delete/6ad508739ca15024b6915def)

[Mike Dabydeen](https://hashnode.com/@firelinks)

[Oct 19](https://hashnode.com/posts/the-delete-that-didnt-delete/6ad508739ca15024b6915def/comment/6ad5fe3bfcadb3d65fdf9d9b)

Rotating the key only makes the purged blocks unreadable once the old key is destroyed, and since Foxstash never holds the key, that last step sits with the app. NIST SP 800-88 Rev. 2 calls this cryptographic erase and defines it as sanitizing the keys, so recovery becomes infeasible because the old key is gone, not because a new one exists. If the meeting recorder keeps old keys around so it can still open older files, the deleted meeting is still recoverable from those blocks.

That runs into your retention default of 2. The old key can only go once no file on disk still needs it, so the order would be purge, rotate, then compact until the fallback checkpoint is also written under the new key, and only then destroy the old one. Destroy it too early and the fallback becomes a file nobody can open. Having the purge report list which key generation each surviving file was written with would tell the app when destroying the old key is safe.

[Brock Claussen](https://hashnode.com/@claus)

[Oct 19](https://hashnode.com/posts/the-delete-that-didnt-delete/6ad508739ca15024b6915def/comment/6ad5fe3bfcadb3d65fdf9d9b#reply-6ad62abdd944c24112939c08)

Thanks Mike, this is right, and sharper than what I wrote. Rotating isn't the erase. Destroying the old key is, and Foxstash can't do that step because it never holds the key.

I checked the code this morning, and the honest version is plainer still: Foxstash 0.9 has no rotation path yet. A store opens with one key, and each file's header records its role, store and generation but not which key encrypted it. So today an app can't rotate in place. It would have to rebuild into a new store under a new key and then destroy the old one.

Your ordering is the one I'd want once rotation exists (purge, rotate, compact until the fallback checkpoint is under the new key, then destroy the old one), and having the purge report show which key each file uses is how the app would know that last step is safe. I've opened an issue for it, crediting you ([github.com/Narcoleptic-Fox/foxstash/issues/71](https://github.com/Narcoleptic-Fox/foxstash/issues/71)), and corrected the paragraph in the post so it doesn't promise a step the library can't do yet.
