This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Author: Alex Langhart | |
| # This script "un-decrypts" a veracrypt drive that was accidentally decrypted twice. | |
| # The veracrypt recovery disk allows the user to decrypt twice, but offers no way | |
| # to un-decrypt it, hence the need for this script. Re-encrypting the drive using | |
| # the standard process wouldn't work because it generates new random salts. | |
| from cryptography.hazmat.primitives import hashes | |
| from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC | |
| import os | |
| from cryptography.hazmat.primitives.ciphers import ( | |
| Cipher, algorithms, modes |