Skip to content

Instantly share code, notes, and snippets.

@nihalpasham
Last active April 5, 2020 07:50
Show Gist options
  • Save nihalpasham/83680cc0016d501099518d5110b9f617 to your computer and use it in GitHub Desktop.
Save nihalpasham/83680cc0016d501099518d5110b9f617 to your computer and use it in GitHub Desktop.
Google pay's -DSSS code sequence
code = [0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1,
0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1,
0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0,
1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1,
1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1]
degree = 7
# print(u)
for mask in range (0, 127):
for seed in range(1, 127):
wq = []
seq = np.array(glfsr(degree, mask, seed))
if np.array_equal(seq, code):
print(seed)
print(mask)
Output--
>> 80
>> 120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment