- Posts: 103
- Thank you received: 5
Ask the community, share ideas, and connect with other LimeSurvey users!
Call to undefined function mcrypt_get_iv_size()
$iv = substr($encryptedKey, 0, mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC));
#install.packages("openssl") # https://cran.r-project.org/web/packages/openssl library(openssl) key.priv <- rsa_keygen(bits = 1024) # Generate RSA keypair key.publ <- key.priv$pubkey # Extract the public key # The respective functions for encryption and decryption s. https://cran.r-project.org/web/packages/openssl/openssl.pdf#page=7 text <- charToRaw("Hello world!") # This is the text we want to encrypt encrypted <- encrypt_envelope(text, pubkey = key.publ) # We encrypt using the public key decrypted <- decrypt_envelope(encrypted$data, encrypted$iv, encrypted$session, key = key.priv) # That's how we decrypt again, using the encrypted data, IV and the encrypted session (I just pretend to know what the latter are). text <- rawToChar(decrypted) # This is the text we want to encrypt text # Yes: it's "Hello world!" again