A lightweight, secure, and deterministic one-time pad encryption tool written in Go.
GoBinPad is a command-line utility that provides strong encryption using a one-time pad (OTP). This tool was inspired by PixelPad and extends the idea to a Go-based implementation, allowing users to securely encrypt and decrypt files with a truly unbreakable cipher—when used correctly.
- Fisher-Yates shuffle of the OTP for additional security.
- ASCII mode for preserving printable characters.
- Flexible OTP sources – The OTP can be any file, such as an image, video, or random binary data.
If you have Go installed, you can install GoBinPad directly from the repository:
go install github.com/sarange/GoBinPad@latestThis will install gobinpad in your $GOPATH/bin directory, allowing you to run it globally.
Alternatively, you can build GoBinPad manually:
git clone https://github.com/sarange/GoBinPad.git
cd GoBinPad
go buildYou can now run ./gobinpad from the current directory.
GoBinPad operates via the command line and provides encryption and decryption functionality.
gobinpad encrypt -i input.txt -p otp.bin -o encrypted.binThis encrypts input.txt using the OTP file otp.bin and saves the output as encrypted.bin.
gobinpad decrypt -i encrypted.bin -p otp.bin -o decrypted.txtThis reverses the encryption and restores the original file.
gobinpad encrypt -i input.txt -p otp.bin -o encrypted_ascii.txt --asciiThis ensures that encrypted output remains within the printable ASCII range.
gobinpad decrypt -i encrypted_ascii.txt -p otp.bin -o decrypted.txt --asciigobinpad encrypt -i input.txt -p otp.bin --ascii --stdoutIf the OTP is compromised, the encrypted message is no longer secure.
- The security of the one-time pad relies entirely on the secrecy and randomness of the OTP.
- Never reuse an OTP – each encryption must have a unique OTP file.
- Your OTP can be any file, such as images, videos, or random binary data, but it must be statistically unpredictable and at least as long as the input file.
- If an attacker gains access to both the encrypted message and the OTP, they can decrypt it instantly.
GoBinPad is licensed under the GNU General Public License v3.0 (GPL-3.0).
See the LICENSE file for more details.
Inspired by PixelPad.