Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.

Commit 5336128

Browse files
committed
added
1 parent fd55813 commit 5336128

1 file changed

Lines changed: 48 additions & 2 deletions

File tree

docs/encrypt/EncryptAFile.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
## Encrypt a file to send to your firend/other person using##
2-
`gpg`
1+
## Encrypt a file to send to your firend/other person using `gpg`
32

43

54

@@ -61,6 +60,53 @@
6160
--------------------------------------------------------------------------------------------------
6261

6362

63+
----------------------------------------------
64+
65+
## Encrypting A file using Openssl -aes-256 : With password
66+
67+
`openssl` `aes-256` based encryption of a folder/file
68+
69+
70+
71+
1. For Open-SSL encryption : Issue the following command in your termianl.
72+
73+
74+
tar cz my_folder/ | openssl enc -aes-256-cbc -e > encrypted.tar.gz.enc
75+
76+
>>**Note** : Here `tar` and `cz`is for making a folder(`my_folder/`) or a file to compress and apply `open-ssl` for encrypting a compressed file using `aes-256` algoritham to an output encrypted file as `encrypted.tar.gz.enc`.
77+
>>**Note** here `my_folder/` can be a folder or a simple file as `example.txt`.
78+
79+
2. After issuing the above command, then the system prompts for password with which the file is to be protected by encrypting, the ouput dialogues includes in following way:
80+
81+
tar: Old option 'g' requires an argument.
82+
Try 'tar --help' or 'tar --usage' for more information.
83+
enter aes-256-cbc encryption password:
84+
Verifying - enter aes-256-cbc encryption password:
85+
86+
87+
88+
89+
3. For OpenSSL Decryption:
90+
91+
92+
openssl aes-256-cbc -d -in encrypted.tar.gz.enc | tar xz
93+
94+
4. Enter the password(used while encrypting the same file) when its prompts for it. Then the file is decrypted.
95+
96+
97+
More source regarding Open-ssl encryption at:
98+
99+
https://zaiste.net/creating_password_protected_gzip_files_from_command_line/
100+
101+
102+
103+
**Note** : Its better to choose `gpg` encryption over `openssl -aes-256` because of high secure 4096 encryption in `gpg` using two differnet keys(such as public and private keys for encryption and decryption respectively)
104+
105+
106+
107+
108+
109+
64110

65111

66112

0 commit comments

Comments
 (0)