THT DUYURU

takipci
chat
Seçenekler

Encrypt your messages via Python Cryptography!

ZiksthemW - ait Kullanıcı Resmi (Avatar)
Üye
Üyelik tarihi:
03/2020
Nereden:
österreich
Mesajlar:
130
Konular:
12
Teşekkür (Etti):
44
Teşekkür (Aldı):
72
Ticaret:
(0) %
2
451
6 Gün önce
#1
Encrypt your messages via Python Cryptography!

Hi Precious
THT family, In this thread we will have a look at python cryptography.



Firstly, What is Encrypt?

Encrption is a double-sided. A double-sided encryption method means that the password is broken and readable afterwards. If you Encrypt anything and send it to someone else, he can Decrypt that file and see your thing

Let's Encrypt!

Firstly, open your CMD and input "python -m pip install cryptography" then we wait until it's downloaded. When it downloaded it will look like the picture down below



then input "python" and "import cryptography" and close cmd

then open Python IDLE, a screen like below will appear;



then press File at the top left and choose New File, a new window will open, you can close the previous one.

Then type the password generation code to Python IDLE

Password generation code;
Kod:
from cryptography.fernet import Fernet

anahtar = Fernet.generate_key() #let's create our key
print (anahtar) #Anahtarımızı yazdıralım

file = open('anahtar.zikstht', 'wb') #You can change the zikstht
file.write(anahtar) # printing the key in the file
file.close()
After typing this, press Run from above and press Run Module, then another screen will appear. If you haven't changed anything, you will see a file called key.zikstht on your desktop. Do not write anything in it.

To try it out, create a txt file called zikstht.txt on the desktop and write something in it, then run the following code

Encrypt Code;
Kod:
from cryptography.fernet import Fernet

file = open('anahtar.zikstht', 'rb')
key = file.read() # Creating our key
file.close()

with open('zikstht.txt', 'rb') as f: #our file and its extension to encrypt
    data = f.read()

fernet = Fernet(key)
encrypted = fernet.encrypt(data)

#Dosyayı şifreleme
with open('zikssifre.zikstht', 'wb') as f: # You can change the ziksthemw part as you want
    f.write(encrypted)
And our text / code is now encrypted! You can see the encrypted text / code on the desktop as zikssifre.zikstht, To Decrypt our file you need to run the code down below

Decrypt code;
Kod:
from cryptography.fernet import Fernet

file = open('anahtar.zikstht', 'rb')
key = file.read()
file.close()

#Opening the file that we Encrypted
with open('zikssifre.zikstht', 'rb') as f: 
    data = f.read()

fernet = Fernet(key)
encrypted = fernet.decrypt(data)

with open('ziksdecrypt.txt', 'wb') as f: #you can change the .txt
    f.write(encrypted)
And now the password is broken! If you haven't changed the names, there will be a file called ziksdecrypt.txt on your desktop where you have your pure text!

If you have a question or an error occurred send your messages via D.M.

---------------------
Baş benim diyen zalimin düşer başı elbette bir gün.
Bi' konu var, kesin kaşınan biri var. Kendim yapamıyorsam yapacak abilerim de var.
Konu ZiksthemW tarafından (6 Gün önce Saat 09:59 ) değiştirilmiştir.
hypertv, "P4RS, blackking1, M3m0ry Teşekkür etti.
Eronmay - ait Kullanıcı Resmi (Avatar)
Deneyimli Moderatör
Üyelik tarihi:
07/2016
Nereden:
Canada
Yaş:
22
Mesajlar:
2.049
Konular:
270
Teşekkür (Etti):
476
Teşekkür (Aldı):
527
Ticaret:
(0) %
6 Gün önce
#2
Cevap: Encrypt your messages via Python Cryptography!
Thank you buddy
---------------------
Konu Eronmay tarafından (6 Gün önce Saat 09:46 ) değiştirilmiştir.
ZiksthemW Teşekkür etti.
M3m0ry - ait Kullanıcı Resmi (Avatar)
Çevirmen
Üyelik tarihi:
06/2017
Nereden:
xD
Mesajlar:
4.068
Konular:
308
Teşekkür (Etti):
10494
Teşekkür (Aldı):
1402
Ticaret:
(0) %
ZiksthemW Teşekkür etti.

Bookmarks


« Önceki Konu | Sonraki Konu »
Seçenekler





1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291