Example #1 0 Show file File: authcipher.c Project: Onekr/openssl_examples int main(void) { EVP_CIPHER_CTX *ctx = NULL; unsigned char key[16]; unsigned char iv[12]; unsigned char tag[16]; unsigned char data[128]; unsigned char ori_msg[128]; unsigned char enc_msg[128+16]; ...
The manual page for openssl_random_pseudo_bytes() has an example I think you want. You can just call bin2hex() on the output of openssl_random_pseudo_bytes() to convert to a hexadecimal number, then hexdec() on that value to convert to decimal. $rand_num = hexdec(bin2hex(openssl_rando...