You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: ciphers/rsa_cipher.py
+10-3
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,7 @@
1
-
importsys, rsa_key_generatorasrkg, os
1
+
importos
2
+
importsys
3
+
4
+
importrsa_key_generatorasrkg
2
5
3
6
DEFAULT_BLOCK_SIZE=128
4
7
BYTE_SIZE=256
@@ -92,7 +95,9 @@ def encryptAndWriteToFile(
92
95
keySize, n, e=readKeyFile(keyFilename)
93
96
ifkeySize<blockSize*8:
94
97
sys.exit(
95
-
"ERROR: Block size is %s bits and key size is %s bits. The RSA cipher requires the block size to be equal to or greater than the key size. Either decrease the block size or use different keys."
98
+
"ERROR: Block size is %s bits and key size is %s bits. The RSA cipher "
99
+
"requires the block size to be equal to or greater than the key size. "
100
+
"Either decrease the block size or use different keys."
"ERROR: Block size is %s bits and key size is %s bits. The RSA cipher requires the block size to be equal to or greater than the key size. Did you specify the correct key file and encrypted file?"
125
+
"ERROR: Block size is %s bits and key size is %s bits. The RSA cipher "
126
+
"requires the block size to be equal to or greater than the key size. "
127
+
"Did you specify the correct key file and encrypted file?"
Copy file name to clipboardexpand all lines: data_structures/linked_list/doubly_linked_list.py
+10-5
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,12 @@
1
1
"""
2
-
- A linked list is similar to an array, it holds values. However, links in a linked list do not have indexes.
2
+
- A linked list is similar to an array, it holds values. However, links in a linked
3
+
list do not have indexes.
3
4
- This is an example of a double ended, doubly linked list.
4
5
- Each link references the next link and the previous one.
5
-
- A Doubly Linked List (DLL) contains an extra pointer, typically called previous pointer, together with next pointer and data which are there in singly linked list.
6
-
- Advantages over SLL - IT can be traversed in both forward and backward direction.,Delete operation is more efficient"""
6
+
- A Doubly Linked List (DLL) contains an extra pointer, typically called previous
7
+
pointer, together with next pointer and data which are there in singly linked list.
8
+
- Advantages over SLL - IT can be traversed in both forward and backward direction.,
9
+
Delete operation is more efficient"""
7
10
8
11
9
12
classLinkedList: # making main class named linked list
@@ -13,7 +16,7 @@ def __init__(self):
13
16
14
17
definsertHead(self, x):
15
18
newLink=Link(x) # Create a new link with a value attached to it
16
-
ifself.isEmpty()==True: # Set the first element added to be the tail
19
+
ifself.isEmpty(): # Set the first element added to be the tail
Copy file name to clipboardexpand all lines: dynamic_programming/bitmask.py
+10-7
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,9 @@
4
4
Here Bitmasking and DP are used for solving this.
5
5
6
6
Question :-
7
-
We have N tasks and M people. Each person in M can do only certain of these tasks. Also a person can do only one task and a task is performed only by one person.
7
+
We have N tasks and M people. Each person in M can do only certain of these tasks. Also
8
+
a person can do only one task and a task is performed only by one person.
8
9
Find the total no of ways in which the tasks can be distributed.
Copy file name to clipboardexpand all lines: dynamic_programming/edit_distance.py
+4-2
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,12 @@
2
2
Author : Turfa Auliarachman
3
3
Date : October 12, 2016
4
4
5
-
This is a pure Python implementation of Dynamic Programming solution to the edit distance problem.
5
+
This is a pure Python implementation of Dynamic Programming solution to the edit
6
+
distance problem.
6
7
7
8
The problem is :
8
-
Given two strings A and B. Find the minimum number of operations to string B such that A = B. The permitted operations are removal, insertion, and substitution.
9
+
Given two strings A and B. Find the minimum number of operations to string B such that
10
+
A = B. The permitted operations are removal, insertion, and substitution.
0 commit comments