Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def i3_statement(lvls):
- lvls = [random.randint(0, 199) for i in range(3)]
- istatement = lambda x: (65**x) % 839
- o_keys = tuple(istatement(lvl) for lvl in lvls)
- rez = ''.join([str(lv).rjust(3,'0') for lv in o_keys])
- return rez, lvls
- def i3post_statement(o_kyes, skeys):
- ipost_statement = lambda ml, lv: (ml**lv) % 839
- o_kyes = [int(o_kyes[i:i + 3]) for i in range(0, len(o_kyes), 3)]
- keys = [ipost_statement(o_kyes[i],skey) for i, skey in enumerate(skeys)]
- rez = ''.join([str(k).rjust(3,'0') for k in keys])
- return rez
- def main():
- oc_keys, sc_keys = i3_statement(sc_keys)
- os_keys, ss_keys = i3_statement(ss_keys)
- s_value = i3post_statement(oc_keys, ss_keys)
- c_value = i3post_statement(os_keys, sc_keys)
- print s_value, c_value
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement