You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 11, 2024. It is now read-only.
## 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.
**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)
0 commit comments