¿Cómo cifra Python una contraseña utilizando una clave pública RSA existente?
& gt& gt& gt? ¿De donde? contraseña. ¿Clave pública? ¿importar? República de Sudáfrica
& gt& gt& gt? ¿De donde? ¿contraseña? ¿importar? Siéntete libre
& gt& gt& gt? ¿Rng? =?Aleatorio.nuevo(). Leer
& gt& gt& gt? ¿Clave RSA? =?RSA.generar(384,?rng)? #?¿este? Voluntad. ¿llevar? ¿respuesta? Durante...
& gt& gt& gt? ¿Picadillo? =?MD5.nuevo(texto sin formato). resumen()
& gt& gt& gt? ¿firmar? =?RSAkey.sign(hash,?rng)
& gt& gt& gt? ¿firmar? #?¿Imprimir? ¿Qué? ¿instalar? ¿RSA? ¿firmar? ¿Aspecto? ¿Como usted? no quieres? Realmente me importa.
('\021\317\313\336\264\315'?...,)
& gt& gt& gt? RSAkey.verify(hash,?firma)? #?¿este? ¿firmar? Voluntad. ¿examinar? Afuera
1
& gt& gt& gt? RSAkey.verify(hash[:-1],?firma)#? ¿este? ¿firmar? Voluntad. Error
0El ejemplo anterior requiere la instalación de la biblioteca de terceros pycrypto.