#
import base64
+from Cryptodome.Cipher import AES
+from Cryptodome import Random
import hashlib
-from Crypto import Random
-from Crypto.Cipher import AES
from oslo_config import cfg
CONF = cfg.CONF
__instance = None
@staticmethod
- def get_instance(key = None):
+ def get_instance(key=None):
if AESCipher.__instance is None:
- print ('Creating the singleton instance')
+ print('Creating the singleton instance')
AESCipher(key)
return AESCipher.__instance
self.bs = 32
if key is None:
- key = CONF.auth.appkey # ---> python3.8 Code version code
- # key= CONF.auth.appkey.encode() ---> Python 2.7 version code
+ key = CONF.auth.appkey # ---> python3.8 Code version code
+ # key= CONF.auth.appkey.encode() ---> Python 2.7 version code
# in Python 3+ key is already a b'' type so no need to encode it again.
self.key = hashlib.sha256(key.encode()).digest()
@staticmethod
def _unpad(s):
- return s[:-ord(s[len(s)-1:])]
-
+ return s[:-ord(s[len(s) - 1:])]
<parent>
<groupId>org.onap.optf.has</groupId>
- <version>2.1.3-SNAPSHOT</version>
+ <version>2.1.4-SNAPSHOT</version>
<artifactId>optf-has</artifactId>
</parent>
<artifactId>optf-has</artifactId>
<name>optf-has</name>
- <version>2.1.3-SNAPSHOT</version>
+ <version>2.1.4-SNAPSHOT</version>
<description>Homing Allocation Service</description>
<modules>