crypto_11.py 394 B

123456789101112131415
  1. def __sec_key(self, data):
  2. """ returns secret key and block id
  3. Args
  4. data: string
  5. """
  6. h = SHA256d(data)
  7. if not self.__convergence_secret:
  8. self.__warn_convergence()
  9. else:
  10. h.update(self.__convergence_secret)
  11. key = h.digest()
  12. del h
  13. id = SHA256d(key).digest()
  14. return key, id