Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.112
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3 /
dist-packages /
Crypto /
PublicKey /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2025-04-10 17:07
DSA.py
13.37
KB
-rw-r--r--
2016-12-28 11:45
ElGamal.py
12.9
KB
-rw-r--r--
2013-10-14 23:38
RSA.py
29.2
KB
-rw-r--r--
2016-12-28 11:45
_DSA.py
3.39
KB
-rw-r--r--
2016-12-28 11:45
_RSA.py
2.7
KB
-rw-r--r--
2016-12-28 11:45
__init__.py
1.83
KB
-rw-r--r--
2013-10-14 23:38
_fastmath.cpython-35m-x86_64-linux-gnu.so
76.19
KB
-rw-r--r--
2016-12-28 11:45
_slowmath.py
6.26
KB
-rw-r--r--
2016-12-28 11:45
pubkey.py
7.9
KB
-rw-r--r--
2016-12-28 11:45
Save
Rename
# # RSA.py : RSA encryption/decryption # # Part of the Python Cryptography Toolkit # # Written by Andrew Kuchling, Paul Swartz, and others # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to exercise all rights associated with the # contents of this file for any purpose whatsoever. # No rights are reserved. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # =================================================================== # __revision__ = "$Id$" from Crypto.PublicKey import pubkey from Crypto.Util import number def generate_py(bits, randfunc, progress_func=None, e=65537): """generate(bits:int, randfunc:callable, progress_func:callable, e:int) Generate an RSA key of length 'bits', public exponent 'e'(which must be odd), using 'randfunc' to get random data and 'progress_func', if present, to display the progress of the key generation. """ obj=RSAobj() obj.e = int(e) # Generate the prime factors of n if progress_func: progress_func('p,q\n') p = q = 1 while number.size(p*q) < bits: # Note that q might be one bit longer than p if somebody specifies an odd # number of bits for the key. (Why would anyone do that? You don't get # more security.) p = pubkey.getStrongPrime(bits>>1, obj.e, 1e-12, randfunc) q = pubkey.getStrongPrime(bits - (bits>>1), obj.e, 1e-12, randfunc) # It's OK for p to be larger than q, but let's be # kind to the function that will invert it for # th calculation of u. if p > q: (p, q)=(q, p) obj.p = p obj.q = q if progress_func: progress_func('u\n') obj.u = pubkey.inverse(obj.p, obj.q) obj.n = obj.p*obj.q if progress_func: progress_func('d\n') obj.d=pubkey.inverse(obj.e, (obj.p-1)*(obj.q-1)) assert bits <= 1+obj.size(), "Generated key is too small" return obj class RSAobj(pubkey.pubkey): def size(self): """size() : int Return the maximum number of bits that can be handled by this key. """ return number.size(self.n) - 1