I am using crypto/cipher to encrypt and decrypt password. Client encrypts the password and sends to remote server over the network. When the server receives the password, during decryption, error “cipher: message authentication failed” is seen. This issue is seen only when communication is over the network.
Issue is not seen when client and server are running on the same machine.
I am following standard implementation mentioned in https://golang.org/src/crypto/cipher/gcm.go
Nonce is of length 12 and new nonce is generated everytime using rand function
Encrypt implements " gcm.Seal(nonce, nonce, byte(passwordStr), nil)"
Decrypt implements " gcm.Open(nil, nonce, encrypted, nil)". Error is encountered in this method.
Let me know if anyone else has faced same issue.