databaseencryptionhashkeylicense-key

How would you store a license key from ex.: Windows 10 or Steam in a Database?


I have a rather simple Question for you.

How would you store a license key from ex.: Windows 10 or Steam in a Database?

My thought process would be that I have to encrypt it, since I need to show the "customer" the plain text key after purchase. which as far as i understand isnt possible if hashed.

Are there other ways to protect the keys? Maybe even not using a Database altogether?

Thanks for your time!


Solution

  • I found an npm package called crypto that allows you to encrypt and descrypt data. I haven't tried it yet but I'll paste you the link i found here so you can go check by yourself.

    https://attacomsian.com/blog/nodejs-encrypt-decrypt-data