Skip to content

Instantly share code, notes, and snippets.

@Esl1h
Created July 8, 2025 13:01
Show Gist options
  • Save Esl1h/91718dde1550e238e31ff1d4e81d979f to your computer and use it in GitHub Desktop.
Save Esl1h/91718dde1550e238e31ff1d4e81d979f to your computer and use it in GitHub Desktop.
Using picocrypt CLI with bash/expect to automate some encryption
#!/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