added RC4 cypher algorithm#4254
Conversation
ghost
left a comment
There was a problem hiding this comment.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
| ''' | ||
|
|
||
| import array as S | ||
| aDict = dict(zip('abcdefghijklmnopqrstuvwxyz.!?()-ABCDEFGHIJKLMNOPQRSTUVWXYZ', |
There was a problem hiding this comment.
Variable and function names should follow the snake_case naming convention. Please update the following name accordingly: aDict
| k = "KEY" | ||
| print("my key is : " + k) | ||
|
|
||
| def bitXor(a,b): |
There was a problem hiding this comment.
Please provide return type hint for the function: bitXor. If the function does not return a value, please provide the type hint as: def function() -> None:
As there is no test file in this pull request nor any test function or class in the file ciphers/rc4.py, please provide doctest for the function bitXor
Variable and function names should follow the snake_case naming convention. Please update the following name accordingly: bitXor
Please provide descriptive name for the parameter: a
Please provide type hint for the parameter: a
Please provide descriptive name for the parameter: b
Please provide type hint for the parameter: b
| else: | ||
| return "1"; | ||
|
|
||
| def text_enc(text): |
There was a problem hiding this comment.
Please provide return type hint for the function: text_enc. If the function does not return a value, please provide the type hint as: def function() -> None:
As there is no test file in this pull request nor any test function or class in the file ciphers/rc4.py, please provide doctest for the function text_enc
Please provide type hint for the parameter: text
| return coded_text.lower() | ||
|
|
||
|
|
||
| def KSA(message,key): |
There was a problem hiding this comment.
Please provide return type hint for the function: KSA. If the function does not return a value, please provide the type hint as: def function() -> None:
As there is no test file in this pull request nor any test function or class in the file ciphers/rc4.py, please provide doctest for the function KSA
Please provide type hint for the parameter: message
Please provide type hint for the parameter: key
|
|
||
| return S | ||
|
|
||
| def PRG(S,message,key): |
There was a problem hiding this comment.
Please provide return type hint for the function: PRG. If the function does not return a value, please provide the type hint as: def function() -> None:
As there is no test file in this pull request nor any test function or class in the file ciphers/rc4.py, please provide doctest for the function PRG
Please provide descriptive name for the parameter: S
Please provide type hint for the parameter: S
Please provide type hint for the parameter: message
Please provide type hint for the parameter: key
|
|
||
| return new_key | ||
|
|
||
| def RC4_en(message,key): |
There was a problem hiding this comment.
Please provide return type hint for the function: RC4_en. If the function does not return a value, please provide the type hint as: def function() -> None:
As there is no test file in this pull request nor any test function or class in the file ciphers/rc4.py, please provide doctest for the function RC4_en
Variable and function names should follow the snake_case naming convention. Please update the following name accordingly: RC4_en
Please provide type hint for the parameter: message
Please provide type hint for the parameter: key
| return encoded | ||
|
|
||
|
|
||
| def RC4_dec(encrypted,key): |
There was a problem hiding this comment.
Please provide return type hint for the function: RC4_dec. If the function does not return a value, please provide the type hint as: def function() -> None:
As there is no test file in this pull request nor any test function or class in the file ciphers/rc4.py, please provide doctest for the function RC4_dec
Variable and function names should follow the snake_case naming convention. Please update the following name accordingly: RC4_dec
Please provide type hint for the parameter: encrypted
Please provide type hint for the parameter: key
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Please reopen this pull request once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions! |
Describe your change:
Created and added RC4 cypher algorithm, both encryption and decryption
Checklist:
Fixes: #{$ISSUE_NO}.