Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #from http://jellymatter.com/2012/01/04/a-secret-message-from-another-dimension/
  2. import random
  3. import numpy as np
  4. from scikits.audiolab import *
  5.  
  6. file = open("encoder.dat","a")
  7.  
  8. def map(x):
  9.     return 3.9*x*(1-x)
  10.  
  11. message_file = Sndfile("message.wav","r")
  12. message = message_file.read_frames(message_file.nframes)
  13.  
  14. chaos = [random.uniform(0,1)]
  15.  
  16. for i in xrange(message_file.nframes-1):
  17.     chaos.append(map(chaos[-1]))
  18.     print >>file, '%g %g'%(i,chaos[-1])
  19. chaos = np.array(chaos)
  20. encrypted_message = chaos+message/100
  21.  
  22.  
  23. format = Format("wav")
  24. encrypted_file = Sndfile("chaos_encrypted.wav", 'w', format, 1, 44100)
  25. encrypted_file.write_frames(encrypted_message)
  26. file.close()