RSAのデジタル署名は
private keyの生成
$ openssl genres -out private.key
public keyの生成
$ openssl rsa -in private.key -pubout > public.key
$ echo -n "hello world" > test.txt
$ openssl dgst -sha1 -sign private.key -out signature test.txt
$ openssl rsautl -verify -in signature -pubin -inkey public.key | hexdump
0000000 30 21 30 09 06 05 2b 0e 03 02 1a 05 00 04 14 2a
0000010 ae 6c 35 c9 4f cf b4 15 db e9 5f 40 8b 9c e9 1e
0000020 e8 46 ed
0000023
$ shamus -a 1 text.txt
2aae6c35c94fcfb415dbe95f408b9ce91ee846ed test.txt
opensslではパディングのアルゴリズムとしてPKCS#1 v1.5(-pkcs), PKCS#1 OAEP(-oaep), SSLv2(-ssl), パディング無し(-raw)に対応している。
コメントする