Files
GmSSL/demos/sdf/sdf-ssf33.sh
2018-11-01 11:21:14 +08:00

17 lines
483 B
Bash
Executable File

#!/bin/bash -x
#key=00000000000000000000000000000000
#iv=00000000000000000000000000000000
key=12345678123456781234567812345678
iv=12345678123456781234567812345678
plaintext="This is the plaintext message."
# FIXME: sm1/ssf33 is unkonwn to enc command
ciphertext=`echo $plaintext | sudo gmssl enc -sm1 -engine sdf -K $key -iv $iv -a`
plaintext=`echo $ciphertext | sudo gmssl enc -sm1 -d -engine sdf -K $key -iv $iv -a`
echo "Ciphertext: $ciphertext"
echo "Plaintext: $plaintext"