Skip to content

A simple utility to perform various AES and RSA related crypto operations.

Notifications You must be signed in to change notification settings

dkvarshney/common-crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Common Crypto

Sample Commands, Please run the corresponding 'help' command for options.

RSA Commands

Command Help:
java -jar common-crypto.jar rsa help

Wrap the data:
java -jar common-crypto.jar rsa wrap
> java -jar common-crypto.jar rsa wrap -wrappingkey=my-public-wrapping.key -material=my-key.key -wrapalgo=RSA_OAEP_SHA256 -output=my-wrapped-key.key

Un-wrap the data:
java -jar common-crypto.jar rsa unwrap
> java -jar common-crypto.jar rsa unwrap -unwrappingkey=my-public-wrapping.key -material=my-key.key -wrapalgo=RSA_OAEP_SHA256 -output=my-unwrapped-key.key

Generate RSA KeyPair:
java -jar common-crypto.jar rsa generate
> java -jar common-crypto.jar rsa generate -keysize=1024 -privatekey=private.key -publickey=public.key

AES Commands

Command Help:
java -jar common-crypto.jar aes help

Generate AES key:
java -jar common-crypto.jar aes generate
> java -jar common-crypto.jar aes generate -keysize=256 -output=aes.key 

... more commands to be added.

Other openssl commands

- Generate RSA private key:
openssl genrsa -out private-key.pem 2048

- Generate RSA public key from private key:
openssl rsa -in private-key.pem -pubout > public-key.pem

- Generate AES key:
openssl rand 32 > aes-key.key

- Convert RSA private key from PEM to DER/PKCS#8 format:
openssl pkcs8 -topk8 -inform PEM -outform DER -in private-key.pem -out private-key.der -nocrypt

- Convert RSA private key from DER/PKCS#8 to PEM format:
openssl rsa -inform DER -outform PEM -in private-key.der -out private-key.pem

About

A simple utility to perform various AES and RSA related crypto operations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages