We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Greetings!
There is a problem with the implementations of the Hamsi and Fugue algorithms. They don't support hmac. That is, any key generates the same output:
package main import ( "crypto/hmac" "fmt" "io" "log" "os" "github.com/deatil/go-hash/hamsi" ) func main() { if len(os.Args) < 3 { fmt.Println("Usage: ./hamsi_hmac_tool <path_to_file> <key>") os.Exit(1) } filePath := os.Args[1] key := []byte(os.Args[2]) file, err := os.Open(filePath) if err != nil { log.Fatal("Error opening file:", err) } defer file.Close() h := hmac.New(hamsi.New256, key) if _, err := io.Copy(h, file); err != nil { log.Fatal("Error reading file:", err) } hashValue := h.Sum(nil) // Convert hash value to hex string hashHex := fmt.Sprintf("%x", hashValue) fmt.Printf("HMAC-Hamsi-256 of file %s: %s\n", filePath, hashHex) }
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Thank You!
Sorry, something went wrong.
No branches or pull requests
Greetings!
There is a problem with the implementations of the Hamsi and Fugue algorithms. They don't support hmac. That is, any key generates the same output:
Thanks in advance.
The text was updated successfully, but these errors were encountered: