From d2f6d5c8415a9d031bc33da22837b85107935fa4 Mon Sep 17 00:00:00 2001 From: brad-anton Date: Sat, 10 Oct 2020 22:34:39 -0400 Subject: [PATCH 1/2] removed legacy algorithms --- hashdd/algorithms/hashdd_md2.py | 41 --------------------------- hashdd/algorithms/hashdd_md4.py | 41 --------------------------- hashdd/algorithms/hashdd_ripemd160.py | 41 --------------------------- 3 files changed, 123 deletions(-) delete mode 100644 hashdd/algorithms/hashdd_md2.py delete mode 100644 hashdd/algorithms/hashdd_md4.py delete mode 100644 hashdd/algorithms/hashdd_ripemd160.py diff --git a/hashdd/algorithms/hashdd_md2.py b/hashdd/algorithms/hashdd_md2.py deleted file mode 100644 index 4edb873..0000000 --- a/hashdd/algorithms/hashdd_md2.py +++ /dev/null @@ -1,41 +0,0 @@ -""" -@brad_anton - -License: - -Copyright 2015 hashdd.com - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" -import re - -from .algorithm import algorithm - -from Crypto.Hash import MD2 - -class hashdd_md2(algorithm): - name = 'hashdd_md2' - validation_regex = re.compile(r'^[a-f0-9]{32}$', re.IGNORECASE) - sample = '67F5641272E1C37A3198D497E0268F1B' - - def setup(self, arg): - self.h = MD2.new() - - def hexdigest(self): - return self.h.hexdigest().upper() - - def update(self, arg): - self.h.update(arg) - -import hashlib -hashlib.hashdd_md2 = hashdd_md2 diff --git a/hashdd/algorithms/hashdd_md4.py b/hashdd/algorithms/hashdd_md4.py deleted file mode 100644 index 28e6391..0000000 --- a/hashdd/algorithms/hashdd_md4.py +++ /dev/null @@ -1,41 +0,0 @@ -""" -@brad_anton - -License: - -Copyright 2015 hashdd.com - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" -import re - -from .algorithm import algorithm - -from Crypto.Hash import MD4 - -class hashdd_md4(algorithm): - name = 'hashdd_md4' - validation_regex = re.compile(r'^[a-f0-9]{32}$', re.IGNORECASE) - sample = '7875BEB6F3F889FE3013D6E8181D48BE' - - def setup(self, arg): - self.h = MD4.new() - - def hexdigest(self): - return self.h.hexdigest().upper() - - def update(self, arg): - self.h.update(arg) - -import hashlib -hashlib.hashdd_md4 = hashdd_md4 diff --git a/hashdd/algorithms/hashdd_ripemd160.py b/hashdd/algorithms/hashdd_ripemd160.py deleted file mode 100644 index 2d113c6..0000000 --- a/hashdd/algorithms/hashdd_ripemd160.py +++ /dev/null @@ -1,41 +0,0 @@ -""" -@brad_anton - -License: - -Copyright 2015 hashdd.com - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" -import re - -from .algorithm import algorithm - -from Crypto.Hash import RIPEMD - -class hashdd_ripemd160(algorithm): - name = 'hashdd_ripemd160' - validation_regex = re.compile(r'^[a-f0-9]{40}$', re.IGNORECASE) - sample = 'B60D032AC971D19D0F05C6FAD8C90FCCBE25AD6A' - - def setup(self, arg): - self.h = RIPEMD.new() - - def hexdigest(self): - return self.h.hexdigest().upper() - - def update(self, arg): - self.h.update(arg) - -import hashlib -hashlib.hashdd_ripemd160 = hashdd_ripemd160 From e4c3c9e36072ff8f2cdd5dd502a1fa7e7b4efbb7 Mon Sep 17 00:00:00 2001 From: brad-anton Date: Sat, 10 Oct 2020 22:35:32 -0400 Subject: [PATCH 2/2] removed legacy algorithms --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f624bce..11adf18 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,6 @@ numpy==1.19.2 Pillow==7.2.0 py-mhash==1.2 pycparser==2.20 -pycrypto==2.6.1 pyparsing==2.4.7 pysha3==1.0.2 python-magic==0.4.18