Showing posts with label crypto. Show all posts
Showing posts with label crypto. Show all posts

Sunday, September 18, 2016

Something for your mind: Polymath Podcast launched


Some episodes
will have more Art content, some will have more Business content, some will have more Science content, and some will be a nice blend of different things. But for sure, the show will live up to its name and provide you with “something for your mind”. It might raise more questions than it answers, and that is fine too.

Episode 000
Listen to Something for your mind on http://Artchiv.es

Francois Dion
@f_dion

Saturday, March 5, 2016

The return of the Los Alamos Memo 10742 -

Modern rendering of the original 1947 Memo 10742

The mathematician prankster


Can you imagine yourself receiving this memo in your inbox in Washington in 1947? There's a certain artistic je ne sais quoi in this memo...

This prank was made by J Carson Mark and Stan Ulam.  A&S was Administration and Services.

And Ulam, well known for working on the Manhattan project, also worked on really interesting things in mathematics. Specifically, a collaboration with Nicholas Constantine Metropolis and John Von Neumann. You might know this as the Monte Carlo method (so named due to Ulam's uncle always asking for money to go and gamble in a Monte Carlo casino...). Some people have learned about a specific Monte Carlo simulation (the first) known as Buffon's needle.

Copying the prankster

When I stumbled upon this many years ago, I decided that it would make a fantastic programming challenge for a workshop and/or class. I first tried it in a Java class, but people didn't get quite into it. Many years later I redid it as part of a weekly Python class I was teaching at a previous employer.

The document is the output of a Python script. In order to make the memo look like it came from the era, I photocopied it. It still didn't look quite right, so I then scanned that into Gimp, bumped the Red and Blue in the color balance tool to give it that stencil / mimeograph / ditto look.


Your assignment


Here is what I asked the students:

"Replicate either:
a) the whole memo
or
b) the list of numbers 
Whichever assignment you choose, the numbers must be generated programmatically."

That was basically it. So, go ahead and try it. In Python. Or in R, or whatever you fancy and post a solution as a comment.

We will come back in some days (so everybody gets a chance to try it) and present some possible methods of doing this. Oh, and why the title of "the return of the Los Alamos Memo"? Well, I noticed I had blogged about it before some years back, but never detailed it...

Learning more on Stan Ulam


See the wikipedia entry and also:

LOS ALAMOS SCIENCE NO. 15, 1987



[EDIT: Part 2 is at: los-alamos-10742-making-of.html]

Francois Dion
@f_dion

Monday, September 9, 2013

@surgeterrix to XOR or not to XOR

By way of twitter


Taking 2 strings of hexadecimal characters, converting hex to binary values, then xorsum the 2 values, and convert sum back to hex.

The other XOR


So the normal xor will not work on strings, so what do you do?

from binascii import hexlify, unhexlify  
from Crypto.Cipher import XOR  
  
# you can encounter hex strings with no spaces  
encrypted = '556e6e216c606f78217264627364757216'  
# or hex strings with spaces  
key = '01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01'  
  
#let's get binary representations  
b_encrypted = unhexlify(encrypted)  
b_key = unhexlify(key.replace(' ','')) # we remove the spaces  
 
#to see a binary string output, use repr: print(repr(b_key))  
  
cosmo = XOR.new(b_key)  
bishop = cosmo.encrypt(b_encrypted) # yeah, encrypt to decrypt  
  
print hexlify(bishop)  
# the above is what was asked  
# the plain ascii decrypted message is print(bishop)  

I think the (not really) hidden references are pretty obvious...However, even in the decrypted message, there is still a question left... :)

François
@f_dion