Skip to content

Commit

Permalink
Merge branch 'master' of github.com:BitcoinSchema/go-bitcoin
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Oct 30, 2020
2 parents 862fccd + 5f9831e commit 65ce5fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func EncryptShared(user1PrivateKey *bsvec.PrivateKey, user2PubKey *bsvec.PublicK
return sharedPrivKey, sharedPubKey, encryptedData, err
}

// EncryptSharedString will encrypt data and provide shared keys for decryption
// EncryptSharedString will encrypt a string to a hex encoded encrypted payload, and provide shared keys for decryption
func EncryptSharedString(user1PrivateKey *bsvec.PrivateKey, user2PubKey *bsvec.PublicKey, data string) (
*bsvec.PrivateKey, *bsvec.PublicKey, string, error) {

Expand All @@ -84,5 +84,6 @@ func EncryptSharedString(user1PrivateKey *bsvec.PrivateKey, user2PubKey *bsvec.P

// Encrypt data with shared key
encryptedData, err := bsvec.Encrypt(sharedPubKey, []byte(data))

return sharedPrivKey, sharedPubKey, hex.EncodeToString(encryptedData), err
}

0 comments on commit 65ce5fc

Please sign in to comment.