#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
""" Un petit test de AES """
from Crypto.PublicKey import RSA
from Crypto.Util.randpool import RandomPool 
import pickle # pour sauvegarder un objet dans un texte

taille_cle=256

fic = open("RSAkey.txt","w")
x=RandomPool(taille_cle) # taille_cle*8 bits
RSAkey=RSA.generate(taille_cle,x.get_bytes)

pickle.dump(RSAkey,fic)
fic.close()

fic = open("RSAkey.public","w")
RSApub = RSAkey.publickey()
pickle.dump(RSApub,fic)
fic.close()
