openssl-evp-sign-DES
所属分类:加密解密
开发工具:C
文件大小:14KB
下载次数:1
上传日期:2016-05-05 02:15:21
上 传 者:
sh-1993
说明: openssl evp签名DES,,
(openssl-evp-sign-DES,,)
文件列表:
Makefile (126, 2016-05-05)
bitwise_operations.c (2884, 2016-05-05)
des_encrypt.c (12488, 2016-05-05)
des_encrypt.h (495, 2016-05-05)
des_key_functions.c (1207, 2016-05-05)
des_utils.h (2533, 2016-05-05)
file_ops.c (1212, 2016-05-05)
file_ops.h (203, 2016-05-05)
main.c (4283, 2016-05-05)
plaintext.txt (22, 2016-05-05)
rsa_utils.c (4511, 2016-05-05)
rsa_utils.h (611, 2016-05-05)
utils.c (903, 2016-05-05)
utils.h (208, 2016-05-05)
This program does the following:
1. Decryptes a session key using a third party RSA public key.
2. Saves the plaintext session key to file.
3. Encryptes a provided plaintext using DES with a key and iv derived from the session key.
4. Signs the ciphertext of the plaintext with an RSA private key.
5. Saves the ciphertext and the signature.
--------------------------------- COMPILATION ------------------------------------
A makefile has been included. All it does is compile everything and include the lcrypto
library required for the EVP openssl calls. Once 'make' has finished a new executable named
'EncAndSign' will be created.
----------------------------------- USAGE -----------------------------------------
To use the program the following must be provided:
1. A plaintext file
2. A PUBLIC KEY in PEM format (presumably a third party public key)
3. A Session Key
4. A PRIVATE KEY in PEM format
Example usage:
./EncAndSign -p plaintext -pubk public.key -sk encrypted.key -privk private_key.pem
Let's go over the arguments:
-p
Include a plaintext file to encrypt using DES.
-pubk Include a public Key file in PEM format
-sk A session key for symmetric encryption.
(Must be 512 bytes, only first 8 bytes will be used.)
-privk A private key file in PEM format
Running the above command will output several files those files are:
1. sessionKey.key The saved plaintext sessionkey.
2. output.bin The ciphertext of the provided DES file.
3. signature A signature of the SHA256 hash of the ciphertext.
---------------------------------- OPTIONAL ARGS -------------------------------------
There are a few convenience arguments that are accepted by the program.
First and foremost, if you want to see what exactly is happening at runtime, enable the
debug argument, '-d'.
Also, incase you want to change the name of the output files here are a few extra args:
-kout Name the file where the plaintext session key will be outputted to.
-out Name the file where the ciphertext of the plaintext will be saved.
-sigout The name of the file where the signature is placed.
近期下载者:
相关文件:
收藏者: