Created
October 3, 2020 12:12
-
-
Save adibenc/797ead20f512241723ea66a3a8fcbafa to your computer and use it in GitHub Desktop.
biji.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python -u | |
import random | |
import string | |
# flag = "FLAG:"+open("flag", "r").read()[:-1] | |
flag = "FLAG:"+("fffaa\n")[:-1] | |
# print(flag) | |
# exit() | |
enkripflag = "" | |
random.seed("random") | |
for c in flag: | |
if c.islower(): | |
enkripflag += chr((ord(c)-ord('a')+random.randrange(0,26))%26 + ord('a')) | |
elif c.isupper(): | |
enkripflag += chr((ord(c)-ord('A')+random.randrange(0,25))%25 + ord('A')) | |
elif c.isdigit(): | |
enkripflag += chr((ord(c)-ord('0')+random.randrange(0,15))%15 + ord('0')) | |
else: | |
enkripflag += c | |
print("Flag yang telah terenkrip : "+enkripflag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment