Exemplo n.º 1
0
 def set_data(self, value):
     """
     :return: Return the encrypted value
     """
     aes = AESCipher(str(settings.SECRET_KEY) + str(self.login))
     self.encrypted_value = aes.encrypt(str(value)).decode('utf8')
     return self.encrypted_value
Exemplo n.º 2
0
 def set_data(self, app_id, app_name, backend_id, repo_name, login, name,
              value):
     """
     :return: Return the encrypted value
     """
     aes = AESCipher(
         str(settings.SECRET_KEY) + str(app_id) + str(backend_id) +
         str(login) + str(name))
     self.app_name = str(app_name)
     self.repo_name = str(repo_name)
     self.login = str(login)
     self.encrypted_value = aes.encrypt(str(value))
     self.encrypted_name = aes.key.hex()
     return self.encrypted_value