Created
July 8, 2025 13:01
-
-
Save Esl1h/91718dde1550e238e31ff1d4e81d979f to your computer and use it in GitHub Desktop.
Using picocrypt CLI with bash/expect to automate some encryption
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
#!/usr/bin/expect -f | |
# This script encrypts a file using picocrypt | |
# Install picocrypt CLI and expect | |
# ./encrypt.exp 'YourPassword' yourFolderOrFiles | |
set password [lindex $argv 0] | |
set file [lindex $argv 1] | |
spawn picocrypt $file | |
expect { | |
-re "Password:" { | |
send "$password\r" | |
exp_continue | |
} | |
-re "Confirm:" { | |
send "$password\r" | |
} | |
} | |
expect eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment