Saravanan666/pypi-org huggingface dataset:
Package: rsa
Pure Python RSA implementationPython-RSAis a pure-Python RSA implementation. It supports
encryption and decryption, signing and verifying signatures, and key
generation according to PKCS#1 version 1.5. It can be used as a Python
library as well as on the commandline. The code was mostly written by
Sybren A.  Stüvel.Documentation can be found at thePython-RSA homepage. For all changes, checkthe changelog.Download and install using:pip install rsaor download it from thePython Package Index.The source code is maintained atGitHuband is
licensed under theApache License, version 2.0SecurityBecause of how Python internally stores numbers, it is very hard (if not impossible) to make a pure-Python program secure against timing attacks. This library is no exception, so use it with care. Seehttps://securitypitfalls.wordpress.com/2018/08/03/constant-time-compare-in-python/for more info.Setup of Development Environmentpython3 -m venv .venv
. ./.venv/bin/activate
pip install poetry
poetry installPublishing a New ReleaseSince this project is considered critical on the Python Package Index,
two-factor authentication is required. For uploading packages to PyPi, an API
key is required; username+password will not work.First, generate an API token athttps://pypi.org/manage/account/token/. Then,
use this token when publishing instead of your username and password.As username, use__token__.
As password, use the token itself, including thepypi-prefix.Seehttps://pypi.org/help/#apitokenfor help using API tokens to publish. This
is what I have in~/.pypirc:[distutils]
index-servers =
    rsa

# Use `twine upload -r rsa` to upload with this token.
[rsa]
  repository = https://upload.pypi.org/legacy/
  username = __token__
  password = pypi-token. ./.venv/bin/activate
pip install twine

poetry build
twine check dist/rsa-4.9.tar.gz dist/rsa-4.9-*.whl
twine upload -r rsa dist/rsa-4.9.tar.gz dist/rsa-4.9-*.whlThepip install twineis necessary as Python-RSA requires Python >= 3.6, and
Twine requires at least version 3.7. This means Poetry refuses to add it as
dependency.
Package: rsa3
Representational Similarity Analysis 3.0Conceived during the RSA retreat 2019 in Blue Mountains,
this version replaces the 2013 version of pyrsa previously at ilogue/pyrsa.DocumentationGetting StartedThe easiest way to install pyrsa is with pip:pipinstallrsa3here is a simple code sample:importnumpy,pyrsadata=pyrsa.data.Dataset(numpy.random.rand(10,5))rdms=pyrsa.rdm.calc_rdm(data)pyrsa.vis.show_rdm(rdms)
Package: rsa4py
Rsa4Pyrsa4py is a python library used to encript and decript string to lists of positive intagersTable of Contents[TOCM][TOC]Key Generationkeys are divided into Public and Private keys. Public keys can be used to encript messages whereas Private can encript and decript.Private Keyto generate a private Key can must use 2 larg prime numbers. the library dose not test if its a prime number so make sure they are. you can alsow specify a modular valuen.nwill be generated if not passed or incorrect.  to generate just use, wherepandqare the prime numbers:key = rsa4py.PrivateKey(p, q)if you want to generate withnkey = rsa4.py.PrivateKey(p, q, n)Public Keyto generate a public key you can eather pass the modular valuenand the encription keye.  or you can generate it from a private key.to generate from public keyk. usepublicKey = k.getPublic()to get fromnandeuse:publicKey = rsa4py.PublicKey(n, e)usageencriptionencription can be done with both the Public and Private Keys. both methods work the same way. For a given keykand a texttthe encripton works as followes.msg = k.encript(t)out will be a list of values of the valus of the encripted text.decriptionfor decription you need to use the Private key. this works as follows. for a given private keyk, an encripted textout,twill be the decripted textt = k.decript(msg)messageduring endcription and decription we used the variablemsgwitch is aCritptoMessageclass witch is a subclass of alist. it contains the entripted message as itself, an intagersignaturewitch is the authentication value of the message.
###saving messages###
to save a message use the following function wherefilenameis the name of the file to save to (no file extension)  andmsgis the message to savemsg.save(filename)you can also use somthing like pickle directly by for example:pickle.dump(msg, open(f"{filename}.msg.p, "wb))###loading messages###
loding is done using the loadMsg function. againfilenameis the name of the file to load from.msg = rsa4py.loadMsg(filename)or using somthing like pickle directly:msg = pickle.load(open(f"{filename}.msg.p", "rb"))authenticationthe library suports authentication of messages. this is done usind the senders private and public keys.###signing###
to sign a messsage you have to use your ownPrivateKeypand a messagemsgmsg.sign(p)###authenticating###
when trying to figure out if a messages signature is correct you have to use thesignatureCorrectmethod. this is done using thePublicKeykof the sender (akap.getPublic())out  = msg.signatureCorrect(k)out will be a boolean value witch is true if the authentication was correct.filed keyssavingyou can alsow save a keykto a file and load them later using:k.save(file)where file is the string containing the filename and path (no extension). the extension will be ".rsa.p".loadingto load a key again you have to run the function:key = rsa4py.loadKey(file)where file is the name of the file containining the key without extension.instalationto install rsa4py via pi just usepip install rsa4py
Package: rsa-algo-madhusree
The RSA algorithm is an asymmetric cryptography algorithm,
which means that it uses a public key and a private key
(i.e two different, mathematically linked keys).
As their names suggest, a public key is shared publicly
while a private key is secret and must not be shared with anyone.The RSA algorithm is named after Ron Rivest, Adi Shamir, and Leonard Adleman
who invented it in 1978.In the code written, the key_Pairs() function returns the public as well as
private keys, which themselves contain 2 values. So, while calling the
function, make sure to use 2 variables, one for the public key and another
for the private key.The actual parameters to the encrypt_data() function should be the plain text
taken input by the user, and the public key. The function returns the
cipher text.The actual parameters to the decrypt_data() function should be the cipher
text, and the private key. The function returns the decrypted text,
which is the original plain text.Happy Cryptography !!Change Log0.0.2 (11/06/2021)Second Release
Package: rsacrack
Rsacrack is a library to carck rsa.InstallStable Version:pipinstall-UrsacrackBeta Version:pipinstall--pre-Ursacrack[Usage]fromrsacrackimportcrack_keyfromrsaimportnewkeys,encrypt,decrypt,PublicKey,PrivateKeyfromsecretsimportchoicefromstringimportprintablefrombinasciiimportb2a_hexkey=newkeys(90)pub_key=eval(str(key[0]).split('PublicKey')[1])msg=choice(printable).encode('ascii')encrypted=encrypt(msg,key[0])priv_key=crack_key(pub_key)hacked=decrypt(encrypted,PrivateKey(*priv_key)).decode('utf-8')print(f'Plain Text:{msg.decode()}')print(f'Cipher Text (HEX):{b2a_hex(encrypted).decode()}')print(f'Hacked Plain Text:{hacked}')
Package: rsa-crypto-python
RSA Encryption Python PackageA Python package for asymmetric encryption using RSA.Installationpipinstallrsa-crypto-pythonUsagefromrsa_crypto_python.rsa_crypto_pythonimportRSAEncryption# Create an instance of the RSAEncryption classrsa=RSAEncryption()# rsa = RSAEncryption(env_file_path=None)# crypt private_to_publicoriginal_text='Hello, this is a secret message!'encrypted_text=rsa.encrypt_with_private_key(original_text)print('Encrypted Text:',encrypted_text)decrypted_text=rsa.decrypt_with_public_key(encrypted_text)print('Decrypted Text:',decrypted_text)# crypt public_to_privateoriginal_text='Hello, this is a secret message!'encrypted_text=rsa.encrypt_with_public_key(original_text)print('Encrypted Text:',encrypted_text)decrypted_text=rsa.decrypt_with_private_key(encrypted_text)print('Decrypted Text:',decrypted_text)ConfigurationSet your public and private key paths in a .env file:PUBLIC_KEY_PATH=/path/to/your/keys/public_key.pemPRIVATE_KEY_PATH=/path/to/your/keys/private_key.pemTo generate keysGenerate Private Keyopensslgenpkey-algorithmRSA-outkeys/private_key.pemGenerate Public Keyopensslrsa-pubout-inkeys/private_key.pem-outkeys/public_key.pemContributingFork the repositoryCreate a new branch (git checkout -b feature/awesome-feature)Commit your changes (git commit -am 'Add awesome feature')Push to the branch (git push origin feature/awesome-feature)Create a new Pull RequestLicenseThis project is licensed under the MIT License - see theLICENSEfile for details.AcknowledgmentsThanks to the cryptography library for providing the tools for secure communication.AuthorUkweh EverestContactFor any inquiries, please contact [exrelativity@gmail.com].
Package: rsactftool
RsaCtfToolRSA multi attacks tool : uncipher data from weak public key and try to recover private key
Automatic selection of best attack for the given public keyAttacks :Weak public key factorizationWiener's attackHastad's attack (Small public exponent attack)Small q (q < 100,000)Common factor between ciphertext and modulus attackFermat's factorisation for close p and qGimmicky Primes methodPast CTF Primes methodSelf-Initializing Quadratic Sieve (SIQS) using Yafu (https://github.com/DarkenCode/yafu.git)Common factor attacks across multiple keysSmall fractions method when p/q is close to a small fractionBoneh Durfee Method when the private exponent d is too small compared to the modulus (i.e d < n^0.292)Elliptic Curve MethodPollards p-1 for relatively smooth numbersMersenne primes factorizationFactordbLondahlNoveltyprimesPartial qPrimefacQichengSame n, huge ebinary polynomial factoringEuler methodPollard RhoUsageusage:RsaCtfTool.py[-h][--publickeyPUBLICKEY][--timeoutTIMEOUT][--createpub][--dumpkey][--ext][--uncipherfileUNCIPHERFILE][--uncipherUNCIPHER][--verbosity{CRITICAL,ERROR,WARNING,DEBUG,INFO}][--private][--ecmdigitsECMDIGITS][-nN][-pP][-qQ][-eE][--keyKEY][--attack{mersenne_primes,pollard_p_1,smallfraction,smallq,boneh_durfee,noveltyprimes,ecm,factordb,wiener,siqs,pastctfprimes,partial_q,comfact_cn,hastads,fermat,nullattack,commonfactors,same_n_huge_e,binary_polinomial_factoring,euler,pollard_rho,all}]Mode 1 : Attack RSA (specify --publickey or n and e)publickey : public rsa key to crack. You can import multiple public keys with wildcards.uncipher : cipher message to decryptprivate : display private rsa key if recoveredMode 2 : Create a Public Key File Given n and e (specify --createpub)n : moduluse : public exponentMode 3 : Dump the public and/or private numbers (optionally including CRT parameters in extended mode) from a PEM/DER format public or private key (specify --dumpkey)key : the public or private key in PEM or DER formatUncipher file./RsaCtfTool.py --publickey ./key.pub --uncipherfile ./ciphered\_filePrint private key./RsaCtfTool.py --publickey ./key.pub --privateAttempt to break multiple public keys with common factor attacks or individually- use quotes around wildcards to stop bash expansion./RsaCtfTool.py --publickey "*.pub" --privateGenerate a public key./RsaCtfTool.py --createpub -n 7828374823761928712873129873981723...12837182 -e 65537Dump the parameters from a key./RsaCtfTool.py --dumpkey --key ./key.pubFactor with ECM when you know the approximate length in digits of a prime./RsaCtfTool.py --publickey key.pub --ecmdigits 25 --verbose --privateFor more examples, look at test.sh fileRequirementsGMPY2SymPyPyCryptoRequestsLibnumSageMath : optional but advisableSage binariesUbuntu 18.04 and Kali specific Instructionsgitclonehttps://github.com/Ganapati/RsaCtfTool.git
sudoapt-getinstalllibgmp3-devlibmpc-dev
pip3install-r"requirements.txt"python3RsaCtfTool.pyMacOS-specific InstructionsIfpip3 install -r "requirements.txt"fails to install requirements accessible within environment, the following command may work.easy_install `cat requirements.txt`TodoBrainstorm moar attack types !
Package: rsa-encryptor
ðŸ“– RSA EncryptorRSA EncryptorA minimal implemetation of asymetric encryption operations usingRSAFunctionalities include:File encryption and decryptionFile signature and verificationSetupPrerequisitesIn order to run this project you need to:InstallPythonInstallInstall the package via pippipinstallrsa_encryptorUsageEncryptionfromrsa_encryptorimportEncryption# Create an objectencryptor=Encryption()# Generate keys or load recivers public key using encryptor.load_keys(public_key_path='path_to_public_key.pem')encryptor.generate_key_pair()# You can export keys as .pemencryptor.export_keys()# Encrypt a fileencryptor.encrypt_file('path_to_file')Decryptionfromrsa_encryptorimportEncryption# Create an objectencryptor=Encryption()# Load your private keyencryptor.load_keys(private_key_path='path_to_private_key.pem')# Decrypt an encrypted fileencryptor.decrypt_file('path_to_encrypted_file')Signaturefromrsa_encryptorimportSignature# Create an objectsigner=Signature()# Generate keys or load your private key using encryptor.load_keys(private_key_path='path_to_private_key.pem')encryptor.generate_key_pair()# Sign a filesigner.sign('path_to_file')Signature Verficationfromrsa_encryptorimportSignature# Create an objectsigner=Signature()# Generate keys or load your private key using encryptor.load_keys(private_key_path='path_to_private_key.pem')# Load senders public keyencryptor.load_keys(public_key_path='path_to_public_key.pem')# Verify the signaturesigner.verify('path_to_file','path_to_signature')ðŸ‘†AuthorsBahir HakimiðŸ‘†ContributingContributions, issues, and feature requests are welcome!Feel free to check theissues page.ðŸ‘†Show your supportIf you like this project leave a start for it.ðŸ‘†AcknowledgmentsThe package functionalities are based onrsabysybrenstuvel.ðŸ‘†LicenseThis project isMITlicensed.ðŸ‘†
Package: rsaes
pip install rsapip install PyCryptoDomexImport modulesimport rsafrom rsaes import rsaesCreat RSA PublicKey and PrivateKeypb, pv = rsa.newkey(1024)Encrypt datacd, ck = rsaes.encrypt(b'Hello', pb)Decrypt datadata = rsaes.decrypt(cd, ck, pv)Used when encrypting large amounts of data using RSA and AES algorithmsMy telegram:https://t.me/sidqdevBy sidq with love
Package: rsa-id-number
rsa-id-numberUtilities for working with South African ID numbers.RSA ID Number Format+-------------------------+
|8|8|0|1|2|3|5|1|1|1|0|8|8|
+-------------------------+
|Y|Y|M|M|D|D|S|S|S|S|C|A|Z|
+-------------------------+YYMMDD: The first 6 digits represent the date of birth (23 January 1988)SSSS: The next 4 digits are used to define the individual's gender (Male)Female: 0000 - 4999Male: 5000 - 9999C: The next digit is used to classify citizenship (SA citizen)SA citizen: 0Permanent resident: 1A: The next digit was used until 1980s to classify raceZ: The last digit is used as a checksum digit to verify the number (Valid)Installation$ pip install rsa-id-numberUsage>>> import rsaidnumber
>>> id_number = rsaidnumber.parse('8801235111088')
>>> id_number.valid
True
>>> id_number.date_of_birth
datetime.datetime(1988, 1, 23, 0, 0)
>>> id_number.gender
<Gender.MALE: 2>
>>> id_number.citizenship
<Citizenship.SA_CITIZEN: 1>
>>> id_number = rsaidnumber.parse('8801235111080')
Traceback (most recent call last):
  ...
ValueError: '8801235111080' contains an invalid checksum digit!
>>> id_number = rsaidnumber.parse('8801235111080', False)
>>> id_number.valid
FalseContributingSetup your development environment by running:$ makethis will create a new Pythonvirtualenv, install all necessary dependencies and run the tests.
Package: rsa-jpv
rsa-jpvA 2048-bit RSA library that operates solely on integers.Aboutrsa-jpv is a 2048-bit RSA library that operates solely on integers. It has an object-oriented interface that's easy and light to use.InstallationTo install the library, open a terminal window and copy the command below.pipinstallrsa-jpvDocumentationAPI DocumentationWarningThis library is not suitable for any production-grade software. Don't use this to encrypt any sensitive information or data. The developer is not responsible for any damage caused by this library.LicenseThis project is under theGNU General Public License v3.0. Please read the terms and conditions stated within the license before attempting any modification or distribution of the software.CopyrightDeveloped and Designed by Justine Paul Sanchez Vitan.Copyright © 2021 Justine Paul Sanchez Vitan. All rights reserved.
Package: rsa-key-info
RSA Key InfoRSA Key Info is a Python script that extracts information from a given RSA public key file. It can display various details about the key, such as its length, modulus, and prime factors, as well as generate a private key from the extracted modulus.This script was inspired by theBreaking RSAbox from TryHackMe.InstallationTo install RSA Key Info, you can use pip:pipinstallrsa-key-infoUsagersa_key_info.py-k<public_key_file>[-l][-m][-f][-p]-k,--key: Path to the RSA public key file (required).-l,--length: Display the length of the RSA key.-m,--modulus: Display the modulus (n) of the RSA key.-f,--factorize: Factorize the modulus into two prime numbers (p and q).-p,--private: Generate a private key using the extracted modulus.Example usage:rsa_key_info.py-kid_rsa.pub-l-m-f-pLicenseThis project is licensed under the MIT License. See theLICENSEfile for details.AcknowledgementsThis script utilizes the pycryptodome library for RSA key handling.
Package: rsalette
Compact pure-Python RSA verification.rsalette provides a compact, < 200 lines, pure-Python 2+3, single file
RSA verification library that is compatible with JSON Web Key.It includes a JSON Web Signature (JWS) / JSON Web Token (JWT)
verifier that can be used for OpenID Connect.It includes asn1lette, a limited asn.1 parser that can parse RSA public
keys from PEM or DER data.rsalette comes with no warranty, but if you’d like to do an audit,
it’s short.Usage:import rsalette
verifier = rsalette.PublicKey.from_jwk({'kty':'RSA', 'e':'AQAB', 'n': ...})
verified_message = verifier.verify(message, signature)For JSON Web Token:openid_configuration = { ... } # value from .well-known/openid-configuration
id_token = '...' # value from OpenID Connect remote user
jwks = requests.get(openid_configuration['jwks_uri']).json()
payload = rsalette.verify_jwt(id_token, jwks)
Package: rsanic
rsanicMicro framework built on top of sanic.py written in Python 3.Installing rsanicpip3installrsanicExample app:Local Redis service must be installed and running at port 6397Shows how to use html or json responsesgitclonehttps://github.com/reformo/rsanic.gitcdrsanic/examplepython3server.pyor if you havepm2installedgitclonehttps://github.com/reformo/rsanic.gitcdrsanic/examplepm2startprocess.ymlThen use any web browser to open address:http://127.0.0.1:8000/orhttp://127.0.0.1:8000/apiorhttp://127.0.0.1:8000/public/data.jsonfor static file access.Notesrsanic will not follow thesemantic versioning schemeuntil the version 1.0.0. So there may be BC breaks.CreditsMehmet KorkmazChange LogNew in version 0.4.0Workers added as an optionMarkdown support addedNew in version 0.3.1Container removedNew in version 0.3.0HTML theming support addedAccess log option addedStatic files support addedStarting to support to get loop outer codebaseController invoke methods, application_global and controller_global methods changed to async methodsNew in version 0.2.2Autoescape option set True for Jinja to prevent XSS attacks.Example pm2 config addedNew in version 0.2.1Requirements updatedNew in version 0.2.0Dependency Injection Container introduced to be used in Rsanic and ApplicationsRequest injected in to AppWorking example addedNew in version 0.1.0Introduced “rsanic” #WIP
Package: rsapy
>>> import rsapy
>>> pub, pri = rsapy.genkey(2**512) # generate rsa key
>>> vig = rsapy.genvigkey(100) # generate vigenere key with length 100
>>> encoded = encode("message", pub)
>>> print(encoded)
>>> decoded = decode(encoded, pri)
>>> print(decoded)
>>> encoded = vigencode("message", vig)
>>> print(encoded)
>>> decoded = vigdecode(encoded, vig)
>>> print(decoded)
Package: rsa-python
rsa_pythonThis module implements the RSA encryption algorithm. Functions included aregenerate_key_pair(bits)which returns a dictionary containing p, q, phi, public, private, modulus, and the time it took to generate the key pair ("time").encrpyt(message, encryption_key, modulus)to encrypt a message, anddecrypt(cipher, decryption_key, modulus)to decrypt a cipher. To install the module, runpip install rsa_python. Below is an example how to use the module.fromrsa_pythonimportrsakey_pair=rsa.generate_key_pair(1024)cipher=rsa.encrypt("Hello World!",key_pair["public"],key_pair["modulus"])decrypted_message=rsa.decrypt(cipher,key_pair["private"],key_pair["modulus"])print(decrypted_message)
Package: rsArtdReformatter
Raw Art Decor to Simple JSONDescriptionThis Python module provides a convenient way to reformat raw art decor JSON into a simplified JSON format. It aims to make the process of working with art decor data easier and more efficient.FeaturesConverts raw art decor JSON into a simplified JSON formatHandles various types of art decor data structuresProvides customizable options for formattingInstallationTo install the module, simply run the following command:TODO
-getimporttoworkintest-howdoiimportapackagethatisinasubfolder
-Amiaddingloggingintothis?
Package: rsatool
eng:
This module implements encryption using the RSA algorithm, as well as indirectly fast and reliable calculation of prime numbers
To generate keys, use the function RSA.get_bit_keys(number of bits to calculate the desired key)importrsatoole,d,n=rsatool.RSA_tool.RSA.get_bit_keys(1024)To encrypt information, use the block encryption function, you can quickly encrypt information of any sizeimportrsatoole,d,n=rsatool.RSA_tool.RSA.get_bit_keys(1024)m='hello world'print(n)c=rsatool.RSA_tool.RSA.get_bit_keys(1024)print(c)To decrypt the message, use the block decryption functionimportrsatoole,d,n=rsatool.RSA_tool.RSA.get_bit_keys(1024)m='hello world'print(n)c=rsatool.RSA_tool.RSA.block_encrypt(m,e,n)print(c)m=rsatool.RSA_tool.RSA.block_decrypt(c,d,n)print(m)For an example of working with the module and testing it, refer to the main.py filerus:
Данный модуль реализует шифрование по алгоритму RSA, а так же косвенно быстрое и надёжное вычисление простых чисел
Для генерации ключей воспользуйтесь функцией RSA.get_bit_keys(число бит для вычисления желаемого ключа)importrsatoole,d,n=rsatool.RSA_tool.RSA.get_bit_keys(256)Для шифрования информации используйте функцию блочного шифрования, Вы можете достаточно быстро шифровать информацию любого объёмаimportrsatoole,d,n=rsatool.RSA.get_bit_keys(256)m='hello world'print(n)c=rsatool.RSA.block_encrypt(m,e,n)print(c)Для расшифрования сообщения используйте фунцию блочного расшифрованияimportrsatoole,d,n=rsatool.RSA.get_bit_keys(256)m='hello world'print(n)c=rsatool.RSA.block_encrypt(m,e,n)print(c)m=rsatool.RSA.block_decrypt(c,d,n)print(m)Для примера работы с модулем и его тестирования обратитесь к файлу main.py
Package: rsatoolbox
Representational Similarity Analysis 3.0Conceived during the RSA retreat 2019 in Blue Mountains.DocumentationGetting StartedTo install the latest stable version of rsatoolbox with pip:pipinstallrsatoolboxor with conda:condainstall-cconda-forgersatoolboxhere is a simple code sample:importnumpy,rsatoolboxdata=rsatoolbox.data.Dataset(numpy.random.rand(10,5))rdms=rsatoolbox.rdm.calc_rdm(data)rsatoolbox.vis.show_rdm(rdms)
Package: rsbac-tools
For details information about RSBAC visitRSBACwebpage.RSBAC in daily use need some task that the admin have to do.For this reason rsbac-tools provides a set of command-line tools.InstallationvisitinstallingwebpageToolsrsbac-backuprsbac-ff-shieldsrsbac-run-jailrsbac-ps-jailrsbac-symlink-redirect