├── LICENSE
├── README.md
└── crypt.sh
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Tahmid Rayat
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Crypt SSL
2 | **Simple File Crypter using Openssl.**
3 |
4 | [](https://github.com/htr-tech)
5 | [](#)
6 | [](#)
7 |
8 | ### Installation :
9 |
10 | ```bash
11 | $ apt install git -y
12 | $ git clone https://github.com/htr-tech/crypt-ssl.git
13 | $ cd crypt-ssl
14 | $ bash crypt.sh
15 | ```
16 |
17 |
18 |
19 | ***Copyright (c) 2021 Tahmid Rayat Under [MIT LICENSE](https://github.com/htr-tech/crypt-ssl/blob/master/LICENSE#L1)***
20 |
21 | ### *📡 Get in Touch :*
22 | [](https://github.com/htr-tech)
23 | [](https://fb.com/tahmid.rayat.official)
24 | [](https://www.instagram.com/tahmid.rayat)
25 |
26 |
--------------------------------------------------------------------------------
/crypt.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ## Crypt SSl : Simple File Crypter using Openssl
4 | ## Author : TAHMID RAYAT
5 | ## Github : https://github.com/htr-tech
6 |
7 | ## If you Copy Then Give the credits :)
8 |
9 | ## GNU GENERAL PUBLIC LICENSE
10 | ## Version 3, 29 June 2007
11 | ##
12 | ## Copyright (C) 2007 Free Software Foundation, Inc.
13 | ## Everyone is permitted to copy and distribute verbatim copies
14 | ## of this license document, but changing it is not allowed.
15 | ##
16 | ## Preamble
17 | ##
18 | ## The GNU General Public License is a free, copyleft license for
19 | ## software and other kinds of works.
20 | ##
21 | ## The licenses for most software and other practical works are designed
22 | ## to take away your freedom to share and change the works. By contrast,
23 | ## the GNU General Public License is intended to guarantee your freedom to
24 | ## share and change all versions of a program--to make sure it remains free
25 | ## software for all its users. We, the Free Software Foundation, use the
26 | ## GNU General Public License for most of our software; it applies also to
27 | ## any other work released this way by its authors. You can apply it to
28 | ## your programs, too.
29 | ##
30 | ## When we speak of free software, we are referring to freedom, not
31 | ## price. Our General Public Licenses are designed to make sure that you
32 | ## have the freedom to distribute copies of free software (and charge for
33 | ## them if you wish), that you receive source code or can get it if you
34 | ## want it, that you can change the software or use pieces of it in new
35 | ## free programs, and that you know you can do these things.
36 | ##
37 | ## To protect your rights, we need to prevent others from denying you
38 | ## these rights or asking you to surrender the rights. Therefore, you have
39 | ## certain responsibilities if you distribute copies of the software, or if
40 | ## you modify it: responsibilities to respect the freedom of others.
41 | ##
42 | ## For example, if you distribute copies of such a program, whether
43 | ## gratis or for a fee, you must pass on to the recipients the same
44 | ## freedoms that you received. You must make sure that they, too, receive
45 | ## or can get the source code. And you must show them these terms so they
46 | ## know their rights.
47 | ##
48 | ## Developers that use the GNU GPL protect your rights with two steps:
49 | ## (1) assert copyright on the software, and (2) offer you this License
50 | ## giving you legal permission to copy, distribute and/or modify it.
51 | ##
52 | ## For the developers' and authors' protection, the GPL clearly explains
53 | ## that there is no warranty for this free software. For both users' and
54 | ## authors' sake, the GPL requires that modified versions be marked as
55 | ## changed, so that their problems will not be attributed erroneously to
56 | ## authors of previous versions.
57 | ##
58 | ## Some devices are designed to deny users access to install or run
59 | ## modified versions of the software inside them, although the manufacturer
60 | ## can do so. This is fundamentally incompatible with the aim of
61 | ## protecting users' freedom to change the software. The systematic
62 | ## pattern of such abuse occurs in the area of products for individuals to
63 | ## use, which is precisely where it is most unacceptable. Therefore, we
64 | ## have designed this version of the GPL to prohibit the practice for those
65 | ## products. If such problems arise substantially in other domains, we
66 | ## stand ready to extend this provision to those domains in future versions
67 | ## of the GPL, as needed to protect the freedom of users.
68 | ##
69 | ## Finally, every program is threatened constantly by software patents.
70 | ## States should not allow patents to restrict development and use of
71 | ## software on general-purpose computers, but in those that do, we wish to
72 | ## avoid the special danger that patents applied to a free program could
73 | ## make it effectively proprietary. To prevent this, the GPL assures that
74 | ## patents cannot be used to render the program non-free.
75 | ##
76 | ## The precise terms and conditions for copying, distribution and
77 | ## modification follow.
78 | ##
79 | ## Copyright (C) 2021 HTR-TECH (https://github.com/htr-tech)
80 | ##
81 |
82 | hasher(){
83 | salter=`echo -n $1 | base64 | md5sum | awk '{print $1}'`
84 | echo $salter
85 | }
86 |
87 | banner(){
88 | echo " ____ ____ _ _ ___ ___ ____ ____ _ "
89 | echo " | |__/ \_/ |__] | [__ [__ | "
90 | echo " |___ | \ | | | ___] ___] |___ "
91 | echo
92 | echo " Simple File Crypter using Openssl"
93 | echo
94 | }
95 |
96 | encode(){
97 | output="$1.enc"
98 | openssl enc -aes-256-ecb -a -pbkdf2 -e -in "$1" -out "$output" -k "$2"
99 | if [[ -e "$output" ]]; then
100 | echo "File : " $output
101 | echo "Pass : " $3
102 | fi
103 | }
104 |
105 | decode(){
106 | if [[ ! -d "out" ]]; then
107 | mkdir out
108 | fi
109 | output="out/${1%.*}"
110 | openssl enc -aes-256-ecb -a -pbkdf2 -d -in "$1" -out "$output" -k "$2"
111 | if [[ -e "$output" ]]; then
112 | echo "File : " $output
113 | fi
114 | }
115 |
116 | if [[ ! `command -v openssl` ]]; then
117 | echo
118 | echo "Installing Openssl"
119 |
120 | if [[ `command -v pkg` ]]; then
121 | pkg install openssl-tool -y
122 | elif [[ `command -v apt` ]]; then
123 | apt install openssl -y
124 | elif [[ `command -v apt-get` ]]; then
125 | apt-get install openssl -y
126 | else
127 | echo
128 | echo "[!] Unfamiliar Distro [!]"
129 | exit 1
130 | fi
131 |
132 | clear
133 | fi
134 |
135 | banner
136 |
137 | if [[ $1 == '-e' && $3 == '-p' && -e $2 && $4 != '' ]]; then
138 | pass=`hasher ${4}`
139 | encode $2 $pass $4
140 | elif [[ $1 == '-d' && $3 == '-p' && -e $2 && $4 != '' ]]; then
141 | pass=`hasher $4`
142 | decode $2 $pass $4
143 | elif [[ $1 == '-p' && $3 == '-e' && $2 != '' && -e $4 ]]; then
144 | pass=`hasher $2`
145 | encode $4 $pass $2
146 | elif [[ $1 == '-p' && $3 == '-d' && $2 != '' && -e $4 ]]; then
147 | pass=`hasher $2`
148 | decode $4 $pass $2
149 | elif [[ $1 == '-h' || $1 == '--help' ]]; then
150 | echo $0 ": Encode Files using Openssl !"
151 | echo
152 | echo "Commands :"
153 | echo $0 "-e : Encode File"
154 | echo $0 "-d : Decode File"
155 | echo $0 "-p : Passphrase"
156 | else
157 | echo "Type : "$0" --help"
158 | fi
159 |
160 |
--------------------------------------------------------------------------------