Not trying to copy bitpatron’s code but I am a bit curious from an engineering perspective on how an individual is able to encrypt/decrypt files and give “access” to subscribers to certain content. (As in decrypt privileges to other user’s files)
From my understanding, if a file is encrypted via { encrypt: true } it will encrypt the data but only YOU as the user has access to decrypt it.
But it seems like this file-key pair can allow some flexibility/workaround for it but having a hard time wrapping my head around it. (shown below)
Ideally I would love to build something similar on debut and only show limited content to “close friends” but as of right now I am currently keeping everything decrypted.
You can also encrypt a file given a certain key of choice but given that when a user unsubscribes you might need to rotate keys. I would suggest you to take a look at Radiks.
Bitpatron’s code is different than the usual scenario (including in Radiks), because you get access to their private files as soon as you do a payment. To do that, my assumption is that the Bitpatron server has access to the private key for that Bitpatron ‘group’, so they can give access the the new user immediately. I’d love to hear if I’m right or any more details about it.
@kkomaz.id, to do this in Debut, I’d recommend creating a Radiks ‘UserGroup’ for a group of close friends. The user that is doing the posting would have to create a UserGroup, and then save their ‘close friends’ posts to be associated with that user group.