Skip to content

Instantly share code, notes, and snippets.

@pistatium
Created January 7, 2020 02:28
Show Gist options
  • Select an option

  • Save pistatium/787773aad2a1133bcaaad81f1eb42a08 to your computer and use it in GitHub Desktop.

Select an option

Save pistatium/787773aad2a1133bcaaad81f1eb42a08 to your computer and use it in GitHub Desktop.
BASE64エンコードで記号三種が含まれてる文字列を探す
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
@pistatium
Copy link
Author

string: `!?=\~s
encoded: YCE/PVx+cw==

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment