From 6ddaf24255fb199ee853c7d897472ee8b7f30e04 Mon Sep 17 00:00:00 2001 From: Prince Date: Tue, 26 Apr 2022 20:39:06 +0200 Subject: [PATCH 1/7] Patch to exception error --- mistyfy/misty.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mistyfy/misty.py b/mistyfy/misty.py index a9fb57f..292dcea 100644 --- a/mistyfy/misty.py +++ b/mistyfy/misty.py @@ -230,10 +230,11 @@ def encode( results = b.b64encode(encode_export.encode("utf-8")) # bs64 the data again _do_results = results.decode("utf-8") # ensure its in strings return _do_results - except ValueError as error: - if error: - return "You are seem to be using some wrong data format. Check your entered data." - return "Failure encrypting data." + except Exception as error: + if isinstance(error, ValueError): + return "You seem to be using some wrong data format. Check your entered data." + else: + return "Failure encrypting data." def decode( @@ -335,11 +336,12 @@ def decode( return "".join(parse) else: return "Unable to decrypt data, incorrect value detected." - except ValueError as error: - if error: - return "You are seem to be using the wrong data value or maybe the data " \ + except Exception as error: + if isinstance(error, ValueError): + return "You seem to be using the wrong data value or maybe the data " \ "used as value in the data argument is incorrect." - return "Failure decrypting data." + else: + return "Failure decrypting data." def signs( From 109c11c334719e8e67357bb428d5ad1a0e68bceb Mon Sep 17 00:00:00 2001 From: Prince Date: Sat, 4 Jun 2022 13:36:19 +0200 Subject: [PATCH 2/7] patch update to v2.0.5 --- mistyfy/misty.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mistyfy/misty.py b/mistyfy/misty.py index 292dcea..1b04159 100644 --- a/mistyfy/misty.py +++ b/mistyfy/misty.py @@ -233,8 +233,7 @@ def encode( except Exception as error: if isinstance(error, ValueError): return "You seem to be using some wrong data format. Check your entered data." - else: - return "Failure encrypting data." + return "Failure encrypting data." def decode( @@ -340,8 +339,7 @@ def decode( if isinstance(error, ValueError): return "You seem to be using the wrong data value or maybe the data " \ "used as value in the data argument is incorrect." - else: - return "Failure decrypting data." + return "Failure decrypting data." def signs( From d25a66743641e9d631e50e36af9c2370d84b9604 Mon Sep 17 00:00:00 2001 From: Prince Date: Sat, 4 Jun 2022 13:36:57 +0200 Subject: [PATCH 3/7] update to v2.0.5 --- CHANGES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index a9f9016..e0691fd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,10 @@ # Mistyfy change log +**Release 2.0.5** - 2022-06-04 +### Patch +* Patches +* Added a defined exception error for encoding and decoding functions + **Release 2.0.4** - 2022-04-16 ### Patch * Patches From b2211acf6348c3d6033e67dd9c1b088d33fdc4bc Mon Sep 17 00:00:00 2001 From: Prince Date: Sat, 4 Jun 2022 13:37:20 +0200 Subject: [PATCH 4/7] update to v2.0.5 --- SECURITY.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index cf3ea7b..7809749 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -5,10 +5,11 @@ Below shows the list of supported version for the mistyfy library | Version | Supported | -| ------- | ------------------ | +|---------|--------------------| +| 2.0.5 | :white_check_mark: | | 2.0.4 | :white_check_mark: | -| 2.0.3 | :white_check_mark: | -| 2.0.2 | :white_check_mark: | +| 2.0.3 | :x: | +| 2.0.2 | :x: | | 2.0.1 | :x: | | 2.0.0 | :x: | | 1.0.1 | :x: | From 43c05b8d4f9e1535d72b74f66160eb9e9197b2e5 Mon Sep 17 00:00:00 2001 From: Prince Date: Sat, 4 Jun 2022 13:37:37 +0200 Subject: [PATCH 5/7] patches and update to v2.0.5 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f6f22e5..ce8913a 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="mistyfy", - version="2.0.4", + version="2.0.5", author="Prince Nyeche", author_email="support@elfapp.website", description="A package that helps encrypt any given string and returns an encrypted string with a signed hash." From 6d9a33c5bc7e25e7ac80afbab69fa13b6d99baee Mon Sep 17 00:00:00 2001 From: Prince Date: Sat, 4 Jun 2022 13:38:46 +0200 Subject: [PATCH 6/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 971fd21..af5edc6 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ secret = b'somesecretkey' # create any secret key, easier if you use os.urandom( # secret = os.urandom(16) a = "This is a secret message or password" b = encode(a, secret, gn) -# output is a dictionary which contains a signed value when decrypting: +# output is a string which contains a signed value when decrypting: # 'eyJtaXN0eWZ5IjogWzQ5Nxxxxxx... c = decode(b, secret, gn) # Output: From d6b66ebf1fcb4ba540e09ecd128bc57e00806330 Mon Sep 17 00:00:00 2001 From: Prince Date: Sat, 4 Jun 2022 13:44:15 +0200 Subject: [PATCH 7/7] patch --- mistyfy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mistyfy/__init__.py b/mistyfy/__init__.py index 40b85e0..8cb24e5 100644 --- a/mistyfy/__init__.py +++ b/mistyfy/__init__.py @@ -10,6 +10,6 @@ from mistyfy.misty import encode, decode, ciphers, signs, verify_signs, generator __all__ = ["encode", "decode", "ciphers", "signs", "verify_signs", "generator"] -__version__ = "v2.0.4" +__version__ = "v2.0.5" __author__ = "Prince Nyeche" __copyright__ = "MIT License"