def initialization(self, key): key = base64.urlsafe_b64decode(key) key = base64.urlsafe_b64encode(key[:32]) self._cipher = Fernet(key)