diff --git a/cmd/crypto-vault-cli/README.md b/cmd/crypto-vault-cli/README.md index 3797f70..da5a96d 100644 --- a/cmd/crypto-vault-cli/README.md +++ b/cmd/crypto-vault-cli/README.md @@ -11,49 +11,33 @@ ## Getting Started +**NOTE**: Keys will be generated internally during the encryption or signature generation operations. + ### Encryption/Decryption **AES example** ```sh +uuid=$(cat /proc/sys/kernel/random/uuid) # Encryption -go run crypto-vault-cli.go encrypt-aes --input data/input.txt --output data/output.enc --keySize 16 --keyDir data/ +go run crypto-vault-cli.go encrypt-aes --input data/input.txt --output data/${uuid}-output.enc --keySize 16 --keyDir data/ # Decryption -go run crypto-vault-cli.go decrypt-aes --input data/output.enc --output data/decrypted.txt --keyDir data/ +go run crypto-vault-cli.go decrypt-aes --input data/${uuid}-output.enc --output data/${uuid}-decrypted.txt --symmetricKey ``` -**RSA Example considering external key generation** +**RSA Example** ```sh -cd data -openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048 -openssl rsa -pubout -in private_key.pem -out public_key.pem -cd - +uuid=$(cat /proc/sys/kernel/random/uuid) # Encryption -go run crypto-vault-cli.go encrypt-rsa --input data/input.txt --output data/encryptedII.txt --publicKey data/public_key.pem +go run crypto-vault-cli.go encrypt-rsa --input data/input.txt --output data/${uuid}-encrypted.txt --keyDir data/ # Decryption -go run crypto-vault-cli.go decrypt-rsa --input data/encryptedII.txt --output data/decryptedII.txt --privateKey data/private_key.pem -``` - -**RSA Example considering internal key generation** - -```sh -# Encryption -go run crypto-vault-cli.go encrypt-rsa --input data/input.txt --output data/encryptedII.txt - -# Decryption -go run crypto-vault-cli.go decrypt-rsa --input data/encryptedII.txt --output data/decryptedII.txt --privateKey data/private_key.pem -``` - -**RSA with PKCS#11 Example considering external key generation** - -```sh -TBD +go run crypto-vault-cli.go decrypt-rsa --input data/${uuid}-encrypted.txt --output data/${uuid}-decrypted.txt --privateKey ``` -**RSA with PKCS#11 Example considering internal key generation** +**RSA with PKCS#11 Example** ```sh TBD @@ -61,12 +45,12 @@ TBD ### Hashing / Verifying signatures -**ECDSA Example considering internal key generation** +**ECDSA Example** ```sh # Sign a file with a newly generated ECC key pair (internally generated) go run crypto-vault-cli.go sign-ecc --input data/input.txt --keyDir data # Verify the signature using the generated public key -go run crypto-vault-cli.go verify-ecc --input data/input.txt --publicKey data/public_key.pem --signature data/signature.sig +go run crypto-vault-cli.go verify-ecc --input data/input.txt --publicKey --signature ``` \ No newline at end of file