CtrlK

Pentest Notes / File Transfers / Windows File Transfer

File Encryption in Windows

Powershell script:
wget https://www.powershellgallery.com/packages/DRTools/4.0.2.3/Content/Functions%5CInvoke-AESEncryption.ps1
Download and import it:
Import-Module .\Invoke-AESEncryption.ps1

Strings

Encodes a string to Base64.
Invoke-AESEncryption -Mode Encrypt -Key "p@ssw0rd" -Text "Secret Text"
Decodes Base64 string.
Invoke-AESEncryption -Mode Decrypt -Key "p@ssw0rd" -Text "base64text=="

Files

Encrypts the file
Invoke-AESEncryption -Mode Encrypt -Key "p@ssw0rd" -Path file.bin
Decrypts the file
Invoke-AESEncryption -Mode Decrypt -Key "p@ssw0rd" -Path file.bin.aes