Giter Club home page Giter Club logo

go-andotp's Introduction

go-andotp

CLI program to encrypt/decrypt andOTP files.

Installation

Linux

Download:

  • x86_64 Intel or AMD 64-Bit CPU
    curl -L "https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-linux-x86_64" \
         -o "go-andotp" && \
    chmod +x "go-andotp"
  • arm64 Arm-based 64-Bit CPU (i.e. in Raspberry Pi)
    curl -L "https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-linux-arm64" \
         -o "go-andotp" && \
    chmod +x "go-andotp"

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

macOS

Download:

  • x86_64 Intel 64-bit
    curl -L "https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-macos-x86_64" \
         -o "go-andotp" && \
    chmod +x "go-andotp"
  • arm64 Apple silicon 64-bit
    curl -L "https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-macos-arm64" \
         -o "go-andotp" && \
    chmod +x "go-andotp"

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

Windows

Download:

  • x86_64 Intel or AMD 64-Bit CPU
    Invoke-WebRequest -Uri "https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-windows-x86_64.exe" -OutFile "go-andotp.exe"
  • arm64 Arm-based 64-Bit CPU
    Invoke-WebRequest -Uri "https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-windows-arm64.exe" -OutFile "go-andotp.exe"

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

Go
go install github.com/grijul/go-andotp

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

  • Encrypt JSON file (Password is asked after hitting Enter. Password is not echoed)
go-andotp -e -i file.json -o file.json.aes
  • Encrypt JSON file (Password is entered through CLI)
go-andotp -e -i file.json -o file.json.aes -p testpass
  • Decrypt JSON file
go-andotp -d -i file.aes.json -o file.json
  • Decrypt JSON file and print json to console
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

go-andotp's People

Contributors

rijulgulati avatar cyclenerd avatar

Stargazers

Sajad Abbasi avatar Guilherme Rugai Freire avatar Dimitris Gravanis avatar  avatar EmThreeMore avatar  avatar Kaito Iwatsuki avatar  avatar Ellie Schieder avatar Sumit Verma avatar Lukas Lange avatar George Wheeler avatar BZK avatar Ersoy Filinte avatar Caleb Woodbine avatar Carlos Alberto Costa Beppler avatar  avatar lucky avatar Dawid Wysokiński avatar ik5 avatar  avatar Akito avatar  avatar Frederic avatar  avatar Bryce Torcello avatar Hélio avatar  avatar Eliah Rusin avatar Jakob Nixdorf avatar

Watchers

 avatar  avatar

Forkers

kichiyaki paroe21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.