Touge-Using RAS encryption and decryption in openssl

Level 1: RSA encryption and decryption Use the OpenSSL command line to implement RSA encryption and decryption of text files. Create a clear text file hello.txt with the content GuetPython Use genrsa to generate a 1024-bit plaintext rsa private key privacy.pem, that is, an unencrypted private key. Use rsa to output the public key file […]

20.5 OpenSSL socket RSA encrypted transmission

The RSA algorithm can also be used for encrypted transmission, but although this type of encryption algorithm is very secure, it is usually not used for large amounts of data transmission. This is because the encryption and decryption process of the RSA algorithm involves a large number of mathematical operations. Especially modular exponentiation (that is, […]

OpenSSL implements SSL network communication

Certainly! Here are the C language programs for a simple OpenSSL client and server that can establish a secure communication channel between them: l in linux environment OpenSSL Server Program (server.c): #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <sys/socket.h> #include <openssl/ssl.h> #include <openssl/err.h> #define CERT_FILE “server.pem” #define KEY_FILE “server.key” void init_openssl() […]

Use the OpenSSL tool to write Bash scripts to encrypt and decrypt password plaintext

Use OpenSSL tools to encrypt and decrypt password plaintext Written By: Xinyao Tian Introduction This document describes a simple way to encrypt and decrypt passwords in a Bash script using the OpenSSL tool. BASE64 encryption and decryption script Use Base64 algorithm to encrypt password The script name is encryptPasswd.sh, and the script content is as […]

20.2 OpenSSL asymmetric RSA encryption and decryption algorithm

The RSA algorithm is an asymmetric encryption algorithm jointly invented by three mathematicians Rivest, Shamir and Adleman, named after them. Named with initials. The security of the RSA algorithm is based on the large number decomposition problem, that is, for a very large composite number, it is very difficult to decompose it into the product […]

openssl+RSA development example (including source code)

1. Introduction to RSA RSA (Rivest-Shamir-Adleman) is an asymmetric encryption algorithm jointly proposed by Ron Rivest, Adi Shamir and Leonard Adleman in 1977. It is the earliest algorithm for public key encryption and digital signatures. . The security of the RSA algorithm is based on the difficulty of factoring large numbers, that is, the problem […]

Openssl develops random number (random) generation (including source code)

openssl random number 1. RAND_bytes() function (recommended) 1.1 Underlying principles 1.2 RAND_bytes function description 1.3 RAND_bytes code example 2. RAND_pseudo_bytes()` function 2.1 RAND_pseudo_bytes() function description 2.2 RAND_pseudo_bytes() code example 3. RAND_seed() function 3.1 RAND_seed() function description 3.2 RAND_seed() code example 4. Summary In OpenSSL, random number generation is a very important task, used to generate […]

openssl+sm3 development example C++

openssl + sm3 development example 1. Introduction to SM3 2. SM3 code example 2.1 SM3 content hash 2.2 SM3 file hash 3. Code address 3. Supplementary knowledge 1. Bit Padding 1. SM3 introduction SM3 is a cryptographic hash function released by China’s State Cryptography Administration (SCA). It is a SHA-3 candidate algorithm and is also […]

Construction of C++ development environment for openssl in linux system

Article directory 1. OpenSSL dynamic compilation and development 1.1 Install OpenSSL library 1.2 Create C++ source code files 1.3 Compiling C++ programs 1.4 Run the program 2. OpenSSL static compilation and development 2.1 OpenSSL download source file 2.2 Compile OpenSSL 2.3 Static linking to OpenSSL 2.4 Run the program 3. openssl version 1. OpenSSL 1.0.x […]