[ / / / / / / / / / / / / / ] [ dir / random / animus / cow / cuteboys / doomer / fringe / lewd / miku / x ]

/qresearch/ - Q Research

Research and discussion about Q's crumbs
Name
Email
Subject
Comment *
File
Password (Randomized for file and post deletion; you may also set your own.)
Archive
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Embed
(replaces files and can be used instead)
Voice recorder Show voice recorder

(the Stop button will be clickable 5 seconds after you press Record)
Options

Allowed file types:jpg, jpeg, gif, png, webm, mp4, pdf
Max filesize is 16 MB.
Max image dimensions are 15000 x 15000.
You may upload 5 per post.


Welcome Page | Index | Archive | Voat Subverse | Poal Sub | Q Posts | Notables | Q Proofs
Q's Board: /projectdcomms/ | Bakers Board: /Comms/ | Legacy Boards: /CBTS/ /TheStorm/ /GreatAwakening/ | Politics News & Debate: /pnd/

File: 11355ef7d91a3fe⋯.jpg (97.02 KB, 620x370, 62:37, encryption.jpg)

File: d4408d6555df557⋯.png (296 KB, 822x911, 822:911, turbo.png)

ff5501  No.9379288

The topic of cryptography has become very popular lately here on the board and in the common meatspace so I set out to better understand things and within about 10 minutes came to the realization that a person could easily spend a lifetime on the topic. After fumbling around for a bit, I wasn't learning anything at all, so I decided to start from the bottom up. That led me to read the book Mastering Turbo Assembler by Tom Swan (pic related), which covers assembly language, which is the language computers use to interpret data. The best way to think of it is if a computer is full of 1's and 0's, assembly language is the way to organize those 1's and 0's so you can bind some function to a specific pattern.

Anyway enough of the boring stuff. Long and short, I realize that us little people aren't really offered easy access encryption methods that are worth a shit. So, I built one.

I understand a lot of (you) are using Windows and I'm sorry but I'm just not up to speed on windows so I really won't be of too much help with that (I don't think) but feel free to ask any questions. I remember most things are an internet search and a click of a button away, so maybe you can find the coordinating method of integrating my encryption script into your workspace.

This is a bit of a work in progress but any debian/linux users I can walk through how I've set this up.

create folder ~/myscripts

then create a file ~/myscripts/supersecret.py

save the following into supersecret.py

"""

this is my supersecret encryption/decryption script using Fernet data encryption

"""

import base64

import os

from cryptography.fernet import Fernet

from cryptography.hazmat.backends import default_backend

from cryptography.hazmat.primitives import hashes

from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC

salt = '\xe1g\x7f\x0c\x8dU\xc2\xd1e$\xe6e\x80\x0c\x9c\xf7'

salt = salt.encode()

def encrypt():

password = input("Please enter a password: ").encode() # This is input in the form of string

kdf = PBKDF2HMAC(

algorithm=hashes.SHA256(),

length=32,

salt=salt,

iterations=100000,

backend=default_backend()

)

key = base64.urlsafe_b64encode(kdf.derive(password)) # Can only use kdf once

key = key.decode()

f = Fernet(key)

token = f.encrypt(input('Please enter your message to encrypt here: ').encode())

token = token.decode()

print('Key:', key)

print('Encrypted message:', token)

def decrypt():

f = Fernet(input('Please enter the key here: '))

token = input('Please enter Encrypted Message here: ').encode()

output = f.decrypt(token)

message = output.decode()

print(message)

def key_gen():

password = input("Please enter a password: ").encode() # This is input in the form of string

kdf = PBKDF2HMAC(

algorithm=hashes.SHA256(),

length=32,

salt=salt,

iterations=100000,

backend=default_backend()

)

key = base64.urlsafe_b64encode(kdf.derive(password)) # Can only use kdf once

key = key.decode()

f = Fernet(key)

print('Key:', key)

def salt_gen():

salt = os.urandom(16)

print(salt)

try:

choice = input('(E)-Encrypt ★ (D)-Decrypt ★ (K)-Keygen ★ (S)-Salt ')

choice = choice.upper()

if choice == 'E' : encrypt()

elif choice == 'D' : decrypt()

elif choice == 'K' : key_gen()

elif choice == 'S' : salt_gen()

else:

print('You have to choose either "E" or "D"')

except:

print('How can you possibly fuck this up?')

exit()

#End of script

Once that is saved, open your terminal and type the following

echo 'alias secret="python3 ~/myscripts/supersecret.py"'

now you can type the word secret into your terminal and have options

E for Encrypt

D for Decrypt

K for Keygen

S for Salt

running out of room so I will go over what you can do with each in next post

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

695a84  No.9379305

File: d0570d31bbd315f⋯.png (390.48 KB, 496x510, 248:255, ClipboardImage.png)

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

ff5501  No.9379478

>>9379288

Ok first E

it will prompt for a password, you can enter anything here, even spaces.

next you will be prompted to add a message. You can add any message you want with whatever.

$secret

(E)-Encrypt ★ (D)-Decrypt ★ (K)-Keygen ★ (S)-Salt e

Please enter a password: nigger

Please enter your message to encrypt here: this is the most secret message you have ever seen

Key: 8jn_PioMQeOLXpC6LDJnKtYPdOtAPaMKU7b375ps7-4=

Encrypted message: gAAAAABe0piYesqL_MP5sEUdq33zicKwfJbkJ4nyyT4AEFaIDmWTxNbBFyipCbC9-afx2ewgMv0XIfV14V9VH2s1HNL5bMaZXqpLHh6yxeTTJyveIwYh_n0SoM-SyUd5cwnLyb6rffMA8TQZkzVRYnuBh4RmfzeedA==

As you can see, you are given a Key as well as an encrypted message.

That key is generated based on the password you entered, so as long as you and the person you wish to share encrypted messages with use the same password, you will get the same key!

Now, to decrypt:

$secret

(E)-Encrypt ★ (D)-Decrypt ★ (K)-Keygen ★ (S)-Salt d

Please enter the key here: 8jn_PioMQeOLXpC6LDJnKtYPdOtAPaMKU7b375ps7-4=

Please enter Encrypted Message here: gAAAAABe0piYesqL_MP5sEUdq33zicKwfJbkJ4nyyT4AEFaIDmWTxNbBFyipCbC9-afx2ewgMv0XIfV14V9VH2s1HNL5bMaZXqpLHh6yxeTTJyveIwYh_n0SoM-SyUd5cwnLyb6rffMA8TQZkzVRYnuBh4RmfzeedA==

this is the most secret message you have ever seen

there you go. Simple enterprise level data encryption!

Fernet Encryption is presently unbreakable. The only way to break it is if your key is compromised.

So, without changing the salt value, if you type "K" for Keygen, you will generate the same key as me for the same passwords.

That's all. Thought I'd share!

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



[Return][Go to top][Catalog][Nerve Center][Random][Post a Reply]
[]
[ / / / / / / / / / / / / / ] [ dir / random / animus / cow / cuteboys / doomer / fringe / lewd / miku / x ]