not working concept
This commit is contained in:
29
decrypt_token.go
Normal file
29
decrypt_token.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// go:build token
|
||||
package main
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"git.niplace.ru/XoxJlopeZi4BB/paxpamir/token"
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
func Must[T any](v T, err error) T {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
func main() {
|
||||
hash := sha256.Sum256(token.Password())
|
||||
s, err := token.Decrypt(
|
||||
string(Must(io.ReadAll(Must(os.Open("encrypted"))))),
|
||||
hash[:],
|
||||
)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Println(s)
|
||||
}
|
Reference in New Issue
Block a user