Current File : //usr/lib64/python2.7/site-packages/Crypto/Cipher/PKCS1_OAEP.pyc |
�
Bd\Rc @ s� d Z d d l m Z d Z d d g Z d d l Z d d l Z d d l Td d l Z d d l m
Z
d d l m Z d d
d
� � YZ
d d e d � d � Z d S( s{ RSA encryption protocol according to PKCS#1 OAEP
See RFC3447__ or the `original RSA Labs specification`__ .
This scheme is more properly called ``RSAES-OAEP``.
As an example, a sender may encrypt a message in this way:
>>> from Crypto.Cipher import PKCS1_OAEP
>>> from Crypto.PublicKey import RSA
>>>
>>> message = 'To be encrypted'
>>> key = RSA.importKey(open('pubkey.der').read())
>>> cipher = PKCS1_OAEP.new(key)
>>> ciphertext = cipher.encrypt(message)
At the receiver side, decryption can be done using the private part of
the RSA key:
>>> key = RSA.importKey(open('privkey.der').read())
>>> cipher = PKCS1_OAP.new(key)
>>> message = cipher.decrypt(ciphertext)
:undocumented: __revision__, __package__
.. __: http://www.ietf.org/rfc/rfc3447.txt
.. __: http://www.rsa.com/rsalabs/node.asp?id=2125.
i����( t
nested_scopess $Id$t newt PKCS1OAEP_CipherN( t *( t ceil_div( t strxorc B s; e Z d Z d � Z d � Z d � Z d � Z d � Z RS( sB This cipher can perform PKCS#1 v1.5 OAEP encryption or decryption.c s[ | � _ | r | � _ n t j j � _ | r<