Civic & Newbie
Hey, I heard youāre diving into a new project. Since youāre experimenting a lot, have you thought about how to keep user data private and stay on the legal side?
Yeah, totally! Iām just making a quick mockāup to see if the idea even works. For privacy Iām going to hash any personal stuff and store it locally, so no server keeps my secrets. Iāll read up on GDPR, but honestly Iām still in the āwhat ifā phaseālike, what if someone copies the code? Iāll toss a big TODO on the side for adding real encryption later. Iāll keep it legal enough to stay in my friendās head, not in a lawyerās office!
Thatās a good start, but hashing alone isnāt enough for personal dataāif someone gets the hash, they might still bruteāforce it, especially if youāre using plain algorithms. Add proper encryption, like AES with a secure key, even for a mockāup, to show youāre treating the data seriously. Also, under GDPR you need a lawful basis and clear purpose, so make sure the data you collect is strictly necessary and that you can prove youāve stored it securely. Even a TODO is a reminder, but better to at least prototype the encryption so youāre not leaving that gap open. That way youāll have a solid foundation before you launch.
Gotcha, yeah Iāll crank up the AES nowāmaybe Iāll write a tiny helper that just throws the key in a secure vault (or my own key vault, lol). Iāll keep the data minimal, so GDPR isnāt a full-on nightmare, just a āno unnecessary stuffā checklist. Iāll add a comment āFIXME: real key managementā and actually test the encryption flow so the hash isnāt the only thing on the table. That should keep the data safe enough for a prototype, and at least I wonāt be throwing my code into the wild with plain hashes. Iāll get on it right after this tab of my brain!
Sounds like a solid plan. Just doubleācheck that the key vault you use is truly secureāif the key is hardācoded or in the same repo, youāre back to square one. Maybe spin up a tiny local HSM emulator or use a dedicated secrets manager so the key never touches the code. That way you keep the prototype clean, and youāll have a real audit trail if someone does want to dig in. Good luck, and keep the comments honestāfuture you will thank you.
Right, right, so Iāll spin up a little local HSM emulatorāmaybe a tiny Docker container that just spits out a key when I ask. Iāll pull that key through an env variable, not hardācode it. Future me will look at the comment that says āFIXME: real HSM neededā and say āyeah, that was a good reminder.ā Thanks for the headsāup, Iāll keep the audit trail clean and not leave the key in my repo. Cheers!
Nice, thatās the kind of detail that keeps everything tight. Good luck with the HSM setupākeep the env vars secret and the audit trail documented. Cheers!
Thanks! Iāll probably drop the HSM in a container, add a quick log, and keep the env vars in a .env file thatās ignored by git. Will definitely write a comment that says āaudit trail hereā so I donāt forget. Cheers!