Proof of number of logins in last N days without saving login times Let's say we have an user Bob. User Bob logs in into our web application every so often. We are a website that tries to save as little information about our users, however we'd like to know which users are inactive so we can suspend their account.
Is there any way we could save information about Bobs logins in a way that doesn't tell us anything about when he logged in, but tells us how many times Bob logged in in last n days?
Assume everything is being done on server side, and only thing we're trying to prevent is data leak in case of a database breach or similar.
I'm not sure cryptography is the way to go. A day level counter could suffice, possibly aggregated later to coarser resolution and deleting any old information you no longer need.
If you want accurate counting for last N days with a certain resolution of last N days the information on what you did N days ago must be kept. It can be inferred by querying count and querying it again after a short while. But you could perhaps do things more fuzzy, maybe store some users data together and inactivate a user group if together they didn't meet the threshold and replace which users are grouped together periodically.