Home

Awesome

go-andotp

CLI program to encrypt/decrypt andOTP files.

Installation

<details> <summary><b>Linux</b></summary>

Download:

To determine your OS version, run getconf LONG_BIT or uname -m at the command line.

</details> <details> <summary><b>macOS</b></summary>

Download:

To determine your OS version, run uname -m at the command line.

</details> <details> <summary><b>Windows</b></summary>

Download:

To determine your OS version, run echo %PROCESSOR_ARCHITECTURE% at the command line.

</details> <details> <summary><b>Go</b></summary>
go install github.com/grijul/go-andotp
</details>

Usage

Usage: go-andotp -i <INPUT_FILE> {-e|-d} [-o <OUT_FILE>] [-p PASSWORD]

  -d    Decrypt file
  -e    Encrypt file.
  -i string
        Input File
  -o string
        Output File. If no file is provided, output is printed to STDOUT
  -p string
        Encryption Password. This option can be skipped to get password prompt.

Examples

go-andotp -e -i file.json -o file.json.aes
go-andotp -e -i file.json -o file.json.aes -p testpass
go-andotp -d -i file.aes.json -o file.json
go-andotp -d -i file.aes.json

Using go-andotp as library

go-andotp can be used as library as well. It implements Encrypt() and Decrypt() functions to encrypt/decrypt text (respectively). It's documentation is available at: https://pkg.go.dev/github.com/grijul/go-andotp/andotp

Example usage:

import "github.com/grijul/go-andotp/andotp"

func main() {
    andotp.Encrypt(...)
    andotp.Decrypt(...)
}

Build

Compile go-andotp on your computer:

go build -o go-andotp main.go

To compile go-andotp for another platform please set the GOARCH and GOOS environmental variables. Example:

GOOS=windows GOARCH=amd64 go build -o go-andotp.exe main.go

To compile go-andotp for Windows, macOS and Linux you can use the script build.sh:

bash build.sh

More help: https://go.dev/doc/install/source#environment

License

MIT