Traveling without a secret key

Stefan Claas sac at 300baud.de
Tue Jul 7 22:57:28 CEST 2020


Stefan Claas wrote:
 
> Stefan Claas wrote:

[...]

> Here's a little Go program, wich does this without the above commands,
> so that it can be used on Windows without OpenSSL:
> 
> package main
> 
> import (
> 	"crypto/sha256"
> 	"bufio"
>       "os"
> 	"fmt"
> 	"encoding/base64"
> 
>       "ekyu.moe/base91"
> )
> 
> func main(){
>     scanner := bufio.NewScanner(os.Stdin)
>     scanner.Scan() // use `for scanner.Scan()` to keep reading
>     src := scanner.Text()
>     hash := sha256.Sum256([]byte(src))
>     fmt.Println(base91.EncodeToString([]byte(hash[:])))
>     fmt.Println(base64.StdEncoding.EncodeToString(hash[:]))
> }

Forgot to mention, issue a 'go get -u ekyu.moe/base91' prior compiling.

Regards
Stefan

--
my 'hidden' service gopherhole:
gopher://iria2xobffovwr6h.onion



More information about the Gnupg-users mailing list