Created
January 7, 2020 02:28
-
-
Save pistatium/787773aad2a1133bcaaad81f1eb42a08 to your computer and use it in GitHub Desktop.
BASE64エンコードで記号三種が含まれてる文字列を探す
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
| import base64 | |
| import random, string | |
| def b64(s): | |
| return (base64.b64encode(s.encode())).decode() | |
| def rnd(): | |
| return ''.join(random.choices(string.punctuation + string.ascii_letters, k=7)) | |
| while True: | |
| r = rnd() | |
| d = b64(r) | |
| if "+" in d and "/" in d and "=" in d: | |
| print(f'string: {r}') | |
| print(f'encoded: {d}') | |
| break |
Author
pistatium
commented
Jan 7, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment