Update some demos

This commit is contained in:
Zhi Guan
2018-11-01 11:21:14 +08:00
parent 676076278d
commit d58931925b
18 changed files with 492 additions and 30 deletions

16
demos/sdf/sdf-ssf33.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/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"