MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / encryptDecryptInt

Function encryptDecryptInt

cipher/rsa/rsa2.go:108–111  ·  view source on GitHub ↗

encryptDecryptInt encrypts or decrypts the data using RSA algorithm

(e, n, data uint64)

Source from the content-addressed store, hash-verified

106
107// encryptDecryptInt encrypts or decrypts the data using RSA algorithm
108func encryptDecryptInt(e, n, data uint64) uint64 {
109 pow := new(big.Int).Exp(big.NewInt(int64(data)), big.NewInt(int64(e)), big.NewInt(int64(n)))
110 return pow.Uint64()
111}
112
113// randomPrime returns two random prime numbers
114func randomPrime() (uint64, uint64) {

Callers 2

EncryptStringMethod · 0.85
DecryptStringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected