Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

Commit 508980a

Browse files
committed
Modified encryption script
1 parent 054e27d commit 508980a

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

RSA-encryption/Attack-LSBit-Oracle/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ if __name__ == "__main__":
4343
option = int(raw_input("Enter your choice: "))
4444
if option == 1:
4545
try:
46-
print "Coming here"
4746
message = raw_input("Enter the message you want to encrypt (in hex): ").decode("hex")
4847
except:
4948
print "Enter proper hex chars"

RSA-encryption/Attack-LSBit-Oracle/encrypt.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def genkey(size):
4848
option = int(raw_input("Enter your choice: "))
4949
if option == 1:
5050
try:
51-
print "Coming here"
5251
message = raw_input("Enter the message you want to encrypt (in hex): ").decode("hex")
5352
except:
5453
print "Enter proper hex chars"

RSA-encryption/Attack-LSBit-Oracle/lsbitoracle.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,21 @@ def lsbitoracle(flag_enc, _decrypt, e, N, upper_limit, lower_limit):
88
99
Function implementing LSBit Oracle Attack
1010
11-
Warning: Function does not return the last byte of the final plaintext
11+
*Warning*: Function does not return the last byte of the final plaintext
1212
13-
:Input parameters:
14-
flag_enc : <type 'str'> : Ciphertext you want to decrypt
15-
_decrypt : <type 'function'>: Function interacting with the server for decryption
16-
e : <type 'int' or 'long'> : Public key exponent
17-
N : <type 'long'> : Modulus
18-
upper_limit: <type 'long'> : Maximum value of corresponding plaintext of flag_enc
19-
lower_limit: <type 'long'> : Minimum value of corresponding plaintext of flag_enc
13+
:parameters:
14+
flag_enc : str
15+
Ciphertext you want to decrypt
16+
_decrypt : function
17+
Function interacting with the server for decryption
18+
e : int/long
19+
Public Key exponent
20+
N : long
21+
Public Key Modulus
22+
upper_limit: long
23+
Maximum value of corresponding plaintext of flag_enc
24+
lower_limit: long
25+
Minimum value of corresponding plaintext of flag_enc
2026
2127
Since the attack messes up with the last byte of the plaintext, lsbitoracle
2228
function returns only flag[:-1]. It returns -1 in case of any Exception

0 commit comments

Comments
 (0)