banner
stmoonar

stmoonar

无心而为
github
telegram
email
zhihu
x

A simple file encryption Python script

To save the private key of the encrypted wallet, I wrote a simple file encryption script, which can also be used to encrypt other things.

Previously, I kept the wallet mnemonic pasted in a txt file on my computer, but I thought about what would happen if the hard drive suddenly failed. Last month, the motherboard of my computer broke down and it couldn't be repaired, but the hard drive was fine and all the data was intact. However, some wallets in browser extensions that didn't back up the mnemonic were directly lost, but they were all wallets with little value.

Then I uploaded the file to the cloud (that's how I used to back it up), but recently I saw a bug reported online about a certain cloud drive, where users could see files stored by others. Although I didn't investigate whether it was a rumor, it made me hesitant to store plaintext directly in the cloud. Below is the code for this Python script:

locker.py

Using the PBKDF2 algorithm for encryption requires entering your own password to decrypt, which at least improves security. The probability of loss due to cloud leakage is also relatively small.

Usage:

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.