Skip to content

Instantly share code, notes, and snippets.

@BugEmir
Created December 18, 2020 22:59
Show Gist options
  • Save BugEmir/6af4395158c3f2d3b1f474cafdb73a49 to your computer and use it in GitHub Desktop.
Save BugEmir/6af4395158c3f2d3b1f474cafdb73a49 to your computer and use it in GitHub Desktop.
from itertools import cycle, izip
import base64
import os
''''
! ENKEL GEBRUIK VOOR EDUCATIEVE DOELEINDEN !
Author: Emirhan Sarikaya
Description: Python programma dat de XOR (Exclusive OR Operator) implement :),
Wij encrypten hier een simpele string door het gebruik maken van XOR
" encString = (encString[:i] + chr(ord(encString[i]) ^ ord(xorSleutelCi)) + encString[i + 1:]); "
''''
if os.geteuid() != 0:
sys.stderr.write("[-] Je hebt root privileges nodig om te te executen")
sys.stderr.close()
sys.exit(1)
else:
def xorEncryptStr(encString):
xorSleutelCi = 'A';
lengte = len(encString);
for i in range(lengte):
encString = (encString[:i] + chr(ord(encString[i]) ^ ord(xorSleutelCi)) + encString[i + 1:]);
print(encString[i], end="");
return encString;
if __name__ == "__main__":
# encrypt string hier :)
encryptDezeTekst = "Emirhan Sarikaya";
print("[+] Encrypted: ", end="");
encryptDezeTekst = xorEncryptStr(encryptDezeTekst);
print("\n");
#en de string in plaintext :)
print("Plain text (decrypted): ", end="");
xorEncryptStr(encryptDezeTekst);
# Met vriendelijke groeten : Emirhan Sarikaya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment