Dehiffrement Cesar

Description

Cours de S�curit� informatique avec plusieurs code de cryptage: RSA, chiffrement Affine , Cesar

Shared by: LauraLimem
-
Stats
views:
5
posted:
6/23/2012
language:
Norwegian
pages:
2
Document Sample
scope of work template
							public class DehiffrementCesar {

       public static void main(String[] args) {

               String lettres="abcdefghijklmnopqrstuvwxyz";

          String message="";

          String messagChiffre="rovvy gybvn, s kw fobi rkzzi dy lo gsdr iye sx mvkcc";

          int k=10;



          for(int i=0; i<messagChiffre.length();i++){

                String carctereEncours=messagChiffre.substring(i, i+1);

                String caractereDechiffre="";

                if((",".equals(carctereEncours))||(" ".equals(carctereEncours))){

                         caractereDechiffre=carctereEncours;



                }else{



                         int rang=lettres.indexOf(carctereEncours);

                         if((rang-k)<0){



                                 rang=rang+26;

                         }

                         int t0=(rang-k)%26;

                         caractereDechiffre=lettres.substring(t0, t0+1);



                }

                message=message+caractereDechiffre;

          }// fin boucle for
    System.out.println(messagChiffre);

    System.out.println(message);



        }



}

						
Related docs
Other docs by LauraLimem
Digramme de Cas d'utilisation(UC)
Views: 14  |  Downloads: 0
J2EE_Chapitre1
Views: 20  |  Downloads: 4
Formation J2EE
Views: 602  |  Downloads: 2
Cours JDBC
Views: 27  |  Downloads: 0
Recherche Artificielle:part2
Views: 4  |  Downloads: 0
la cryptographie dans la vie courante
Views: 141  |  Downloads: 0
Exercice Corrigé
Views: 706  |  Downloads: 1
Semiologie multim�dia:partie2
Views: 13  |  Downloads: 0
HTML Formulaire
Views: 9  |  Downloads: 0