This is a demo project implement in c language . The demos includes:
- How to use openssl encode/decode base64, encrypt/decrypt by rsa/des.
- How to do http post by libcurl.
All the resources are from Internet.
Please install libopenssl and libcurl development package first.
'make pc=1' will build binary for PC.
'make' will build binary for arm, but have not test yet.
Generate key by following commands:
-
generate private key
$openssl genrsa -out private.pem 2048 -
view key components
$openssl rsa -text -in private.pem -
extract public key
$openssl rsa -pubout -in private.pem -out public.pem -
covert to pkcs8
$openssl pkcs8 -in private.pem -topk8 -out private.pk8 -nocrypt