Jump to content
Sign in to follow this  
Usr6

[accesibil] You will break RSA

Recommended Posts

Cute-Funny-Dog-2012-05.jpg

from Crypto.PublicKey import RSA
from Crypto import Random
import sys

print """                                 
 _|_|_|      _|_|_|  _|_|_|_|_|  
 _|    _|  _|            _|      
 _|_|_|      _|_|        _|      
 _|    _|        _|      _|      
 _|    _|  _|_|_|        _|      
                                 
      www.RSTforums.com                          
"""

if raw_input("This challenge can harm your brain, cause STRESS, nopti nedormite, abuz de cafea, etc. \n are you de acorrd?'DA / NU': ") == "YES":
	pass
else:
	sys.exit("you... you... YOU just ai pierdut. goodbye")

cheie_publica = """-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAwwdzXD9RvYp+Oq2Ajf1F
ix2IVypQg2Hu5Ebj7DShQyUKpH2FIOxfE0TIS4EzbYQp58Z2yDORnZGIoj3i3/tn
6N7g2JnIlX9yxH0f5n1aJRTuqxNWy5Zhl24FYXuI0ByVSY4voL+h47rkCBWzbq7q
7W7Q9444TOoni6iysDsw2wCLT+bpoBtLytRNRFMxRWhtuGCwmyofxltVzqDP8sV/
hztdibN8J1P3HbfkaIGshpCDusbvUosIztFp3vUN5Cy95UyogcUNbZGnoZqNyFmS
usX8h0XvnFMRwxbwwRJXwUDiqlla5+ygQU1OxgnNPSW/Tm35IoxfWeUwhR79nrA6
cYGkr/YmKhBmTQ+r4iUONNMfu9Z6ykB93B4XAhbKIcjW9bX5J8wFT6mmYrBE7MaS
ZSP+XH6P9hkx3u2aZNT5xUuf58h6JcGQ/9NCYx3rfgSN4sqsAaAi3r6pSCVOMXXF
QIImdzuq0yo2z4drWb0BfCjvG5Sc04/w+q1e7pJ79EUH/9kwQ59ZgaSjVSinfeGE
xbmaQtvKKiE1r2eAUieRkA6eYT4xdORqOF0K4W8yAiY2CbKaPQWsdLkL5qUCgaqf
yn2Tbll8gRdfrURiV2AWHtzC2qq+6GhfroFq8o4zDIFtvWPHvIZ599cUIxJ52KmI
i9urppmxxYsYoUtqW3O3bB8CAwEAAQ==
-----END PUBLIC KEY-----"""

the_cheie = RSA.importKey(cheie_publica)

def criptare(mesaj):
	pachet = ""
	for i in mesaj:
		pachet += the_cheie.encrypt(i, 32)[0].encode("hex")
	return pachet

mesaj_secret = "the secret message"

with open("crack-me.txt", "w") as handle:
	handle.write(criptare(mesaj_secret))
	handle.close()
	sys.exit()

crack-me.txt: http://rgho.st/7ppYvrjd4

 

Au trecut bacu:

  • Upvote 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...