Eve The Magician Does A Quantum Robust Trick — Learning With Errors

Prof Bill Buchanan OBE
Jun 12 · 4 min read

How did she do it?

C:\Python27> python lwe.pyPublic key [37, 52, 72, 92, 22, 42, 67, 27, 47, 62]Selected values [22, 72, 42, 37, 47]Message to send: 0Sum is: 220Encrypted is: 220Message is 0
C:\Python27>python lwe.pyPublic key [37, 52, 72, 92, 22, 42, 67, 27, 47, 62]Selected values [22, 62, 67, 52, 37]Message to send: 0Sum is: 240Encrypted is: 240Message is 0
C:\Python27>python lwe.pyPublic key [37, 52, 72, 92, 22, 42, 67, 27, 47, 62]Selected values [92, 62, 22, 72, 67]Message to send: 1Sum is: 315Encrypted is: 316Message received is 1
C:\Python27> python lwe.pyPublic key [37, 52, 72, 92, 22, 42, 67, 27, 47, 62]Selected values [42, 47, 37, 22, 62]Message to send: 1Sum is: 210Encrypted is: 211Message received is 1
import sysimport numpy as npimport randompublic_key=[]vals = [5, 8, 12, 16, 2, 6, 11, 3, 7, 10]s = 5e = 12message = 1file='1111'val=0for x in range(0,len(vals)):public_key.append(vals[x]*s+e)res = random.sample(public_key, 5)print "Public key",public_keyprint "Selected values",ressum = np.sum(res)print "Message to send:",messageprint 'Sum is:',sumif (message==1):sum=sum+1print 'Encrypted is:',sumrem = sum % sif (rem%2==0):print 'Message received is 0'else:print 'Message received is 1'

ASecuritySite: When Bob Met Alice

This publication brings together interesting articles related to cyber security.

Prof Bill Buchanan OBE

Written by

Prof at Napier. Serial innovator. Crypto Punk. Believer in fairness, justice & freedom. EU Citizen. Auld Reekie native. Old World Breaker. New World Creator.

ASecuritySite: When Bob Met Alice

This publication brings together interesting articles related to cyber security.