diff options
author | Sybren A. St?vel <sybren@stuvel.eu> | 2011-07-19 21:43:34 +0200 |
---|---|---|
committer | Sybren A. St?vel <sybren@stuvel.eu> | 2011-07-19 21:43:34 +0200 |
commit | 9c9319212b1353e22ff1a1b9d244cea01634ebe8 (patch) | |
tree | 07a091cac19ed479a8be74664ca88498b419c239 | |
parent | 8e1f835ca06f00cebc5cab842078d8ad9be69769 (diff) | |
download | rsa-9c9319212b1353e22ff1a1b9d244cea01634ebe8.tar.gz |
Fixed file permissions
-rw-r--r--[-rwxr-xr-x] | rsa/__init__.py | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | rsa/_version133.py | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | rsa/core.py | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | rsa/keygen.py | 20 | ||||
-rw-r--r-- | rsa/pkcs1.py | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | rsa/transform.py | 0 |
6 files changed, 20 insertions, 2 deletions
diff --git a/rsa/__init__.py b/rsa/__init__.py index 063889c..063889c 100755..100644 --- a/rsa/__init__.py +++ b/rsa/__init__.py diff --git a/rsa/_version133.py b/rsa/_version133.py index 1adae42..1adae42 100755..100644 --- a/rsa/_version133.py +++ b/rsa/_version133.py diff --git a/rsa/core.py b/rsa/core.py index aa72957..aa72957 100755..100644 --- a/rsa/core.py +++ b/rsa/core.py diff --git a/rsa/keygen.py b/rsa/keygen.py index 1f1c9a7..0678e37 100755..100644 --- a/rsa/keygen.py +++ b/rsa/keygen.py @@ -11,6 +11,25 @@ The public key consists of a dict {e: ..., , n: p*q) import rsa.prime +class PublicKey(object): + '''Represents a public RSA key. + + This key is also known as the 'encryption key'. It contains the 'e' and 'n' + values. + ''' + + __slots__ = ('e', 'n') + + def __init__(self, e, n): + self.e = e + self.n = n + + def __getitem__(self, key): + return self.__slots__[key] + +class PrivateKey(object): + pass + def extended_gcd(a, b): """Returns a tuple (r, i, j) such that r = gcd(a, b) = ia + jb """ @@ -122,7 +141,6 @@ def newkeys(nbits): return ( {'e': e, 'n': n}, {'d': d, 'p': p, 'q': q, 'n': n} ) - if __name__ == '__main__': print 'Running doctests 1000x or until failure' import doctest diff --git a/rsa/pkcs1.py b/rsa/pkcs1.py index 584d244..752a6fd 100644 --- a/rsa/pkcs1.py +++ b/rsa/pkcs1.py @@ -1,4 +1,4 @@ -'''Functions for PKCS1 version 1.5 +'''Functions for PKCS1 version 1.5 encryption and signing This module implements certain functionality from PKCS1 version 1.5. For a very clear example, read http://www.di-mgt.com.au/rsa_alg.html#pkcs1schemes diff --git a/rsa/transform.py b/rsa/transform.py index a43cfb7..a43cfb7 100755..100644 --- a/rsa/transform.py +++ b/rsa/transform.py |