openssl command line sm4 encryption and decryption

Example of sms4 algorithm standard data

Key: 0123456789abcdeffedcba9876543210

Plain text: 0123456789abcdeffedcba9876543210

Ciphertext: 681edf34d206965e86b3e94f536e4246

gmssl command:

mssl sms4-ecb -e -nopad -in plain.dat -K 0123456789abcdeffedcba9876543210 -out cipher.dat

gmssl sms4-ecb -d -nopad -in cipher.dat -K 0123456789abcdeffedcba9876543210 -out msg.dat

Examples:

View plaintext data, symmetric encryption, view ciphertext data, symmetric decryption, view decrypted data

hexdump -C plain.dat

gmssl sms4-ecb -e -nopad -in plain.dat -K 0123456789abcdeffedcba9876543210 -out cipher.dat

hexdump -C cipher.dat 

gmssl sms4-ecb -d -nopad -in cipher.dat -K 0123456789abcdeffedcba9876543210 -out msg.dat

hexdump -C msg.dat

 

 

Guess you like

Origin blog.csdn.net/beebeeyoung/article/details/115191617