cifrado r92 - in trunk: . package/cifrado/codeurs
- From: bersace svn gnome org
- To: svn-commits-list gnome org
- Subject: cifrado r92 - in trunk: . package/cifrado/codeurs
- Date: Sun, 6 Apr 2008 18:03:40 +0100 (BST)
Author: bersace
Date: Sun Apr 6 18:03:40 2008
New Revision: 92
URL: http://svn.gnome.org/viewvc/cifrado?rev=92&view=rev
Log:
Inversion du chiffrage/DÃchiffrage.
Modified:
trunk/ChangeLog
trunk/package/cifrado/codeurs/roulement.py
trunk/package/cifrado/codeurs/vigenere.py
Modified: trunk/package/cifrado/codeurs/roulement.py
==============================================================================
--- trunk/package/cifrado/codeurs/roulement.py (original)
+++ trunk/package/cifrado/codeurs/roulement.py Sun Apr 6 18:03:40 2008
@@ -32,7 +32,7 @@
else:
liste = self.letters["upper"]
- result+=liste[(liste.index(char) + self.decalage) % 26]
+ result+=liste[(liste.index(char) - self.decalage) % 26]
else:
result+= char
Modified: trunk/package/cifrado/codeurs/vigenere.py
==============================================================================
--- trunk/package/cifrado/codeurs/vigenere.py (original)
+++ trunk/package/cifrado/codeurs/vigenere.py Sun Apr 6 18:03:40 2008
@@ -28,7 +28,7 @@
for char in text:
if (char.isalpha()):
casse = self.casse (char)
- index = (self.letters[casse].index(char) + self.letters[self.casse(clef[i])].index(clef[i])) % 26
+ index = (self.letters[casse].index(char) - self.letters[self.casse(clef[i])].index(clef[i])) % 26
result+= self.letters[casse][index]
i = (i + 1) % len(clef)
else:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]