manteca / enfile

Bash tool to encrypt and decrypt a file with ssh public and private keys with easy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

enfile

Bash tool to encrypt and decrypt a file with ssh public and private keys with easy

Overview

The tool is an abstraction on using openssl to encrypting file using a public and private key.

Explanation

Encryption process

  • run the command indicating which file
  • The tool use the openssl to create a random base64 to 32 characters and store it in a file created locally named key.bin
  • This key.bin files is used to encrypt the files requested
  • It create locally a new file with the same name and adds the extension .enc
  • After the encrypting the file, the key.bin is encrypted with the public_key and rename key.bin.enc
  • Both file with extension .enc should be share. <file_name_to_encrypt>.enc and key.bin.enc

Decryption process

  • User should received at least 2 files. <file_name_encrypted>.enc and key.bin.enc
  • have all files in the same folder
  • the running command will look for the beside for the encrypted file and the private key. The key.bin.enc file
  • With the private key it will decrypt the file to key.bin
  • The file key.bin will be use t decrypt and store it as <file_name_encrypted>

How to Encrypt-Decrypt a file

Encrypt a file with public-key

./enfile enc <file_to_encrypt> <public_key_to_use>

Decrypt a file with private-key

./enfile dec <file_to_dencrypt> <private_key_to_use>

Resources

About

Bash tool to encrypt and decrypt a file with ssh public and private keys with easy

License:GNU Lesser General Public License v3.0


Languages

Language:Shell 100.0%