diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-31 06:16:28 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-31 06:16:28 +0000 |
commit | 3257247d6a7a83be6b8ae09c54428df88f0988be (patch) | |
tree | 36b8c4807fa6f815c6353fb7872c1003cbeaf559 | |
parent | a66234ab61322f9c34528c3d5fbe4ad9b2b7c844 (diff) |
automatic import of python-crack
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-crack.spec | 424 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 426 insertions, 0 deletions
@@ -0,0 +1 @@ +/crack-0.7.tar.gz diff --git a/python-crack.spec b/python-crack.spec new file mode 100644 index 0000000..46f2f51 --- /dev/null +++ b/python-crack.spec @@ -0,0 +1,424 @@ +%global _empty_manifest_terminate_build 0 +Name: python-crack +Version: 0.7 +Release: 1 +Summary: Crack tools all here! +License: MIT +URL: https://leesoar.com/explore +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/5e/92/c8bbd0f9efc4bf27fb144142344a672bda9baeefea8534bbd6205b43c8eb/crack-0.7.tar.gz +BuildArch: noarch + +Requires: python3-fontTools +Requires: python3-requests +Requires: python3-pycryptodome +Requires: python3-pysodium + +%description + +## Crack + +Crack tools all here! + +Currently support custom aes, base58, base64, secrets, seal box, unsigned shift and font decode, other will be coming soon. + +Thanks for use. + + +### How to use +#### Base58 +```python +import crack + + +crack.b58encode("leesoar.com") +# Return: Tt1fb89EdWohEDa + +crack.b58decode("Tt1fb89EdWohEDa") +# Return: leesoar.com +``` + + +#### Base64 +```python +import crack + + +crack.b64encode(b"leesoar.com", b64_map="9240gsB6PftGXnlQTw_pdvz7EekDmuAWCVZ5UF-MSK1IHOchoaxqYyj8Jb3LrNiR") +# Return: DBvFmjNVmZb5DjY= + +crack.b64decode("DBvFmjNVmZb5DjY=", b64_map="9240gsB6PftGXnlQTw_pdvz7EekDmuAWCVZ5UF-MSK1IHOchoaxqYyj8Jb3LrNiR") +# Return: b'leesoar.com' +``` + + +#### Decimal to other +```python +import crack + + +# default base is 58 +crack.dec_to_other(9527) +# Return: [2, 48, 15] +``` + + +#### Font Decode +> Thanks fonttools. + +If a site font was displayed wrong, it can be corrected like this: +```python +from crack import Font + +font = Font("font_file.ttf") +font.mapping([1, 3, 2, 4, 0, 5, 7, 8, 6, 9], start=2) +font.load(Font("https://nskol.com/font/default.ttf")) +font.decode("\ue627\ueb1c\uefc6") # This is the correct result. +``` + + +#### Array's partition +```python +import crack + + +[print(x, end=", ") for x in crack.partition("gmapi.cn", size=3)] +# Print: gma, pi., cn, + + +[print(x) for x in crack.partition(["g", "m", "a", "p", "i", ".", "c", "n"], size=3)] +# Print: ['g', 'm', 'a'], ['p', 'i', '.'], ['c', 'n'], +``` + +### Unsigned shift +```python +import crack + + +crack.unsigned_right_shift(-2048, 1) +# Output: 2147482624 +# It likes JavaScript ">>>" + +... + +``` + + +### AES +* **If you use 'from crack import Aes', it will automatically fix the bug of importing crypto error.** +```python +from crack import Aes + + +aes = Aes(key="xxxxxxxxx", iv="xxxxxxxxx") +aes.encrypt_hex(b"xxxxxxxxxxx") +aes.encrypt_byte(b"xxxxxxxxxxx") +... + +``` + + + +### Secrets +```python +import crack + + +crack.token_hex(16) +# Output: 984a0877240ec62afaf6bbab175ab985 [Random] + +... + +``` + + + +%package -n python3-crack +Summary: Crack tools all here! +Provides: python-crack +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-crack + +## Crack + +Crack tools all here! + +Currently support custom aes, base58, base64, secrets, seal box, unsigned shift and font decode, other will be coming soon. + +Thanks for use. + + +### How to use +#### Base58 +```python +import crack + + +crack.b58encode("leesoar.com") +# Return: Tt1fb89EdWohEDa + +crack.b58decode("Tt1fb89EdWohEDa") +# Return: leesoar.com +``` + + +#### Base64 +```python +import crack + + +crack.b64encode(b"leesoar.com", b64_map="9240gsB6PftGXnlQTw_pdvz7EekDmuAWCVZ5UF-MSK1IHOchoaxqYyj8Jb3LrNiR") +# Return: DBvFmjNVmZb5DjY= + +crack.b64decode("DBvFmjNVmZb5DjY=", b64_map="9240gsB6PftGXnlQTw_pdvz7EekDmuAWCVZ5UF-MSK1IHOchoaxqYyj8Jb3LrNiR") +# Return: b'leesoar.com' +``` + + +#### Decimal to other +```python +import crack + + +# default base is 58 +crack.dec_to_other(9527) +# Return: [2, 48, 15] +``` + + +#### Font Decode +> Thanks fonttools. + +If a site font was displayed wrong, it can be corrected like this: +```python +from crack import Font + +font = Font("font_file.ttf") +font.mapping([1, 3, 2, 4, 0, 5, 7, 8, 6, 9], start=2) +font.load(Font("https://nskol.com/font/default.ttf")) +font.decode("\ue627\ueb1c\uefc6") # This is the correct result. +``` + + +#### Array's partition +```python +import crack + + +[print(x, end=", ") for x in crack.partition("gmapi.cn", size=3)] +# Print: gma, pi., cn, + + +[print(x) for x in crack.partition(["g", "m", "a", "p", "i", ".", "c", "n"], size=3)] +# Print: ['g', 'm', 'a'], ['p', 'i', '.'], ['c', 'n'], +``` + +### Unsigned shift +```python +import crack + + +crack.unsigned_right_shift(-2048, 1) +# Output: 2147482624 +# It likes JavaScript ">>>" + +... + +``` + + +### AES +* **If you use 'from crack import Aes', it will automatically fix the bug of importing crypto error.** +```python +from crack import Aes + + +aes = Aes(key="xxxxxxxxx", iv="xxxxxxxxx") +aes.encrypt_hex(b"xxxxxxxxxxx") +aes.encrypt_byte(b"xxxxxxxxxxx") +... + +``` + + + +### Secrets +```python +import crack + + +crack.token_hex(16) +# Output: 984a0877240ec62afaf6bbab175ab985 [Random] + +... + +``` + + + +%package help +Summary: Development documents and examples for crack +Provides: python3-crack-doc +%description help + +## Crack + +Crack tools all here! + +Currently support custom aes, base58, base64, secrets, seal box, unsigned shift and font decode, other will be coming soon. + +Thanks for use. + + +### How to use +#### Base58 +```python +import crack + + +crack.b58encode("leesoar.com") +# Return: Tt1fb89EdWohEDa + +crack.b58decode("Tt1fb89EdWohEDa") +# Return: leesoar.com +``` + + +#### Base64 +```python +import crack + + +crack.b64encode(b"leesoar.com", b64_map="9240gsB6PftGXnlQTw_pdvz7EekDmuAWCVZ5UF-MSK1IHOchoaxqYyj8Jb3LrNiR") +# Return: DBvFmjNVmZb5DjY= + +crack.b64decode("DBvFmjNVmZb5DjY=", b64_map="9240gsB6PftGXnlQTw_pdvz7EekDmuAWCVZ5UF-MSK1IHOchoaxqYyj8Jb3LrNiR") +# Return: b'leesoar.com' +``` + + +#### Decimal to other +```python +import crack + + +# default base is 58 +crack.dec_to_other(9527) +# Return: [2, 48, 15] +``` + + +#### Font Decode +> Thanks fonttools. + +If a site font was displayed wrong, it can be corrected like this: +```python +from crack import Font + +font = Font("font_file.ttf") +font.mapping([1, 3, 2, 4, 0, 5, 7, 8, 6, 9], start=2) +font.load(Font("https://nskol.com/font/default.ttf")) +font.decode("\ue627\ueb1c\uefc6") # This is the correct result. +``` + + +#### Array's partition +```python +import crack + + +[print(x, end=", ") for x in crack.partition("gmapi.cn", size=3)] +# Print: gma, pi., cn, + + +[print(x) for x in crack.partition(["g", "m", "a", "p", "i", ".", "c", "n"], size=3)] +# Print: ['g', 'm', 'a'], ['p', 'i', '.'], ['c', 'n'], +``` + +### Unsigned shift +```python +import crack + + +crack.unsigned_right_shift(-2048, 1) +# Output: 2147482624 +# It likes JavaScript ">>>" + +... + +``` + + +### AES +* **If you use 'from crack import Aes', it will automatically fix the bug of importing crypto error.** +```python +from crack import Aes + + +aes = Aes(key="xxxxxxxxx", iv="xxxxxxxxx") +aes.encrypt_hex(b"xxxxxxxxxxx") +aes.encrypt_byte(b"xxxxxxxxxxx") +... + +``` + + + +### Secrets +```python +import crack + + +crack.token_hex(16) +# Output: 984a0877240ec62afaf6bbab175ab985 [Random] + +... + +``` + + + +%prep +%autosetup -n crack-0.7 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-crack -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 0.7-1 +- Package Spec generated @@ -0,0 +1 @@ +b570a03631e160e11b0894b1b29bd95a crack-0.7.tar.gz |