Is cryptography in Go hard?
reddit.com·13w·
Discuss: r/golang

I been having a slower time learning cryptography in Go compared to other languages due to all of the juggling to simply encrypt a string or the limitations of 72 characters to generate a secure hash with a salt.

Is there some sort of 3rd party library that is popular, maintained and trusted that I do not know of that makes crypto in go much easier.

For example, this is how I generate a hash with as salt with timing attack security but I am stuck with using bcrypt which is limited to 72 characters.

package main

import (
"encoding/hex"
"fmt"

"golang.org/x/crypto/bcrypt"
)

const Password = "mypassword"

func main() {
//Generate hash with salt
hashWithSaltBytes, err := bcrypt.GenerateFromPassword([]byte(Password), bcrypt.MinCost)
if err != nil {
//,,,
}

//Convert bytes into hex...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help