Encryption using 2 Factor Authentication through an external drive with Python
Install using pip install Physical2FA
Please read the entire file to prevent data loss
Physical2FA currently only supports Windows 7 and newer
Physical2FA encrypts and decrypts your files using an external drive.
It can all be done in 2 lines of code, no more wasting time encrypting and decrypting!
from Physical2FA import encrypt
encrypt
It’s as easy as that!
Make sure that you also have cryptography installed. You can install it using
pip install cryptography
When you first run the program, you will need to create a key. You can do this by running
from Physical2FA import write_key
write_key
This will create a file called ‘key.key’ in your external drive. For this to work, make sure that your external drive has the letter ‘D’. you can find out how to change your drive’s letter on Microsoft docs. I highly recommend that you check the specifications section at the end of this doc.
Physical2FA will encrypt all the files and subdirectories in the directory that you run the program in. However, it will not encrypt the python file in which you run the program in as long as the file is named ‘lock.py’. Physical2FA will only encrypt up to 5 subdirectories, but support for more is in development. What this means that if you look at the following model of a sample directory:
Things underlined in green are encrypted. So you can see that files that are nested up to 5 subdirectories are encrypted.
Here is how to encrypt in steps:
encrypt
If it is your first time encrypting, you should also import write_key and add 'write_key' before you encrypt. Once you have a key, it is very important that you **_NEVER_** run write_key again. It will rewrite your key, and you will not be able to recover your files if they are encrypted.
3. Execute the file, and your files/subdirectories should be encrypted.
The encryption is as secure as your external drive is!
#### Decrypt
To decrypt, you run the same code as encryption, but you replace all instances of 'encrypt' with 'decrypt'. So it would be:
```python
from Physical2FA import decrypt
decrypt
You can download the file called fail_safe.py from https://github.com/Atharv2/Physical2FA. It will guide you through encrypting or decrypting your files one at a time.
This software does not come with a warranty. I am not responsible if you encrypt some important files and then can’t decrypt them. The chances of this happening are very slim, but you should still exercise caution while using this software. I will not be held responsible for any damage that occurs from using this software. If you use this program, you understand that You are using it on your own will and you understand the risks.