Class Chiffreur

java.lang.Object
  |
  +--Chiffreur

public class Chiffreur
extends Object

Un chiffeur RSA utilisant des EPA.


Field Summary
private  EPA b
          b, un entier tiré aléatoirement tel que 1 < b < φ(n) et pgcd( b, φ(n) ) = 1
private  EPA n
          n = p·q
 
Constructor Summary
Chiffreur(EPA n, EPA b)
          Construit le chiffreur RSA à partir des entiers n et b spécifiés
Chiffreur(String nomfichier)
          Construit le chiffreur RSA à partir de la clé publique (les entiers n et b) lue à partir du fichier spécifié.
 
Method Summary
 EPA chiffre(EPA clair)
          Chiffre l'EPA spécifié.
 void chiffre(String entréeNomFichier, String sortieNomFichier)
          Chiffre un fichier vers un autre.
protected  void chiffreEtEcrit(byte[] block, PrintStream sortie)
          Chiffre le bloc de données spécifié et l'écrit sur le flot de sortie spécifié.
 void écritCléPublique(String nomfichier)
          Enregistre la clé publique dans le fichier spécifié.
 EPA getB()
          Renvoie b.
 EPA getN()
          Renvoie n.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

n

private EPA n
n = p·q

b

private EPA b
b, un entier tiré aléatoirement tel que 1 < b < φ(n) et pgcd( b, φ(n) ) = 1
Constructor Detail

Chiffreur

public Chiffreur(EPA n,
                 EPA b)
Construit le chiffreur RSA à partir des entiers n et b spécifiés
Parameters:
n - p·q
b - un entier tiré aléatoirement tel que 1 < b < φ(n) et pgcd( b, φ(n) ) = 1

Chiffreur

public Chiffreur(String nomfichier)
          throws IOException
Construit le chiffreur RSA à partir de la clé publique (les entiers n et b) lue à partir du fichier spécifié.
Throws:
IOException - En cas d'erreur d'entrée/sortie.
Method Detail

getN

public EPA getN()
Renvoie n.

getB

public EPA getB()
Renvoie b.

écritCléPublique

public void écritCléPublique(String nomfichier)
                      throws IOException
Enregistre la clé publique dans le fichier spécifié.
Throws:
IOException - En cas d'erreur d'entrée/sortie.

chiffre

public EPA chiffre(EPA clair)
Chiffre l'EPA spécifié.

chiffreEtEcrit

protected void chiffreEtEcrit(byte[] block,
                              PrintStream sortie)
                       throws IOException
Chiffre le bloc de données spécifié et l'écrit sur le flot de sortie spécifié.
Throws:
IOException - En cas d'erreur d'entrée/sortie.

chiffre

public void chiffre(String entréeNomFichier,
                    String sortieNomFichier)
             throws IOException
Chiffre un fichier vers un autre.
Throws:
IOException - En cas d'erreur d'entrée/sortie.