otp generation and encryption added with go
This commit is contained in:
33
Go/main.go
Normal file
33
Go/main.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"flag"
|
||||
"one-time-pad-utils/otp_gen"
|
||||
"one-time-pad-utils/otp_encrypt"
|
||||
)
|
||||
|
||||
func main(){
|
||||
var genpad = flag.Bool("generate", false, "Generate a new One-Time Pad using CSPRNG")
|
||||
var genpadchunks = flag.Int("chunks", 200, "Specify the amount of chunks to generate")
|
||||
var encryptmessage = flag.String("encrypt", "", "Specify a message you wish to encrypt")
|
||||
var decryptmessage = flag.String("decrypt", "", "Specify a message you wish to decrypt")
|
||||
var otpkey = flag.String("key", "", "The specify required key for encryption and decryption")
|
||||
var _ = encryptmessage
|
||||
var _ = decryptmessage
|
||||
var _ = otpkey
|
||||
|
||||
flag.Parse()
|
||||
|
||||
if *genpad {
|
||||
fmt.Printf("%v\n", otpgen.GenerateOTP(*genpadchunks))
|
||||
return
|
||||
}
|
||||
|
||||
if *encryptmessage != "" {
|
||||
fmt.Printf("%v\n", otpencrypt.OTPEncrypt(*encryptmessage,*otpkey))
|
||||
return
|
||||
}
|
||||
|
||||
flag.PrintDefaults()
|
||||
}
|
Reference in New Issue
Block a user