|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/Crypto/Cipher/ |
Upload File : |
�
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<