22CLI program to encrypt/decrypt [ andOTP] ( https://github.com/andOTP/andOTP ) files.
33
44## Installation
5- ``` sh
6- $ go get github.com/grijul/go-andotp
5+
6+ <details >
7+ <summary ><b >Linux</b ></summary >
8+
9+ Download:
10+ * [ x86_64] ( https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-linux-x86_64 ) Intel or AMD 64-Bit CPU
11+ ``` shell
12+ curl -L " https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-linux-x86_64" \
13+ -o " go-andotp" && \
14+ chmod +x " go-andotp"
15+ ```
16+ * [ arm64] ( https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-linux-arm64 ) Arm-based 64-Bit CPU (i.e. in Raspberry Pi)
17+ ``` shell
18+ curl -L " https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-linux-arm64" \
19+ -o " go-andotp" && \
20+ chmod +x " go-andotp"
21+ ```
22+
23+ To determine your OS version, run ` getconf LONG_BIT ` or ` uname -m ` at the command line.
24+ </details >
25+
26+ <details >
27+ <summary ><b >macOS</b ></summary >
28+
29+ Download:
30+ * [ x86_64] ( https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-macos-x86_64 ) Intel 64-bit
31+ ``` shell
32+ curl -L " https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-macos-x86_64" \
33+ -o " go-andotp" && \
34+ chmod +x " go-andotp"
35+ ```
36+ * [ arm64] ( https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-macos-arm64 ) Apple silicon 64-bit
37+ ``` shell
38+ curl -L " https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-macos-arm64" \
39+ -o " go-andotp" && \
40+ chmod +x " go-andotp"
41+ ```
42+
43+ To determine your OS version, run ` uname -m ` at the command line.
44+ </details >
45+
46+ <details >
47+ <summary ><b >Windows</b ></summary >
48+
49+ Download:
50+ * [ x86_64] ( https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-windows-x86_64.exe ) Intel or AMD 64-Bit CPU
51+ ``` powershell
52+ Invoke-WebRequest -Uri "https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-windows-x86_64.exe" -OutFile "go-andotp.exe"
53+ ```
54+ * [ arm64] ( https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-windows-arm64.exe ) Arm-based 64-Bit CPU
55+ ``` powershell
56+ Invoke-WebRequest -Uri "https://github.com/RijulGulati/go-andotp/releases/latest/download/go-andotp-windows-arm64.exe" -OutFile "go-andotp.exe"
57+ ```
58+ To determine your OS version, run ` echo %PROCESSOR_ARCHITECTURE% ` at the command line.
59+ </details >
60+
61+ <details >
62+ <summary ><b >Go</b ></summary >
63+
64+ ``` shell
65+ go install github.com/grijul/go-andotp
766```
67+ </details >
868
969## Usage
10- ``` sh
70+ ``` text
1171Usage: go-andotp -i <INPUT_FILE> {-e|-d} [-o <OUT_FILE>] [-p PASSWORD]
1272
1373 -d Decrypt file
@@ -22,20 +82,20 @@ Usage: go-andotp -i <INPUT_FILE> {-e|-d} [-o <OUT_FILE>] [-p PASSWORD]
2282
2383## Examples
2484- Encrypt JSON file (Password is asked after hitting ``` Enter ``` . Password is not echoed)
25- ``` sh
26- $ go-andotp -e -i file.json -o file.json.aes
85+ ``` shell
86+ go-andotp -e -i file.json -o file.json.aes
2787```
2888- Encrypt JSON file (Password is entered through CLI)
29- ``` sh
30- $ go-andotp -e -i file.json -o file.json.aes -p testpass
89+ ``` shell
90+ go-andotp -e -i file.json -o file.json.aes -p testpass
3191```
3292- Decrypt JSON file
33- ``` sh
34- $ go-andotp -d -i file.aes.json -o file.json
93+ ``` shell
94+ go-andotp -d -i file.aes.json -o file.json
3595```
3696- Decrypt JSON file and print json to console
37- ``` sh
38- $ go-andotp -d -i file.aes.json
97+ ``` shell
98+ go-andotp -d -i file.aes.json
3999```
40100
41101## Using go-andotp as library
@@ -52,5 +112,25 @@ func main() {
52112}
53113```
54114
115+ ## Build
116+ Compile ` go-andotp ` on your computer:
117+
118+ ``` shell
119+ go build -o go-andotp main.go
120+ ```
121+
122+ To compile ` go-andotp ` for another platform please set the ` GOARCH ` and ` GOOS ` environmental variables.
123+ Example:
124+ ``` shell
125+ GOOS=windows GOARCH=amd64 go build -o go-andotp.exe main.go
126+ ```
127+
128+ To compile ` go-andotp ` for Windows, macOS and Linux you can use the script ` build.sh ` :
129+ ``` shell
130+ bash build.sh
131+ ```
132+
133+ More help: < https://go.dev/doc/install/source#environment >
134+
55135# License
56136[ MIT] ( https://github.com/grijul/go-andotp/blob/main/LICENSE )
0 commit comments