Crates.io | cifra |
lib.rs | cifra |
version | 0.9.3+post3 |
source | src |
created_at | 2021-10-22 22:17:13.624479 |
updated_at | 2021-12-15 19:48:45.423447 |
description | Console command to crypt and decrypt texts using classic methods. |
homepage | https://github.com/dante-signal31/cifra |
repository | |
max_upload_size | |
id | 469668 |
size | 2,107,127 |
cifra — Library and console command to crypt and decrypt texts using classic methods.
| $ cifra MODE [-h | --help ]
cifra is a console command and a python library to cipher and decipher texts using classic methods. It also performs cryptoattacks against those methods.
I've implemented this while I read Al Sweigart's "Cracking Codes with Python". While doing it I also developed and alternative Python implementation to assess implementations differences between Python and Rust. Structure of both implementations is almost identical, so it is interesting to compare side-to-side functions of both implementation to realize how the same things must be expressed in Python and Rust.
Some conclusions are evident: Python is extremely expressive and can implement in just few lines what Rust requires many more; on the other hand Rust is extremely performant and can execute the same calculations many times quicker than Python. However, I've found out a really useful conclusion: Python is a great prototyping language for Rust, reflexion topics apart the vast majority of everything else that you can do in Python can be easily implemented in Rust too.
Be aware that cryptographics operations are inherently slow. Cifra does not return any visual feedback until it has finished its work, so if you run a command and it keeps waiting for many seconds don't think it is stuck and finish execution, chances are that command is simply doing its calculations silently. Be patient and eventualy command will return its result.
Manage dictionaries to perform crypto attacks.
| $ cifra dictionary ACTION
Possible actions:
create: Create a dictionary of unique words.
| $ cifra dictionary create NEW_DICTIONARY_NAME
delete: Remove an existing dictionary.
| $ cifra dictionary delete DICTIONARY_NAME_TO_DELETE
update: Add words to an existing dictionary.
| $ cifra dictionary update DICTIONARY_NAME_TO_UPDATE PATH_TO_FILE_WITH_WORDS
list: Show existing dictionaries.
| $ cifra dictionary list
Cipher a text using a key.
| $ cifra cipher ALGORITHM_NAME CIPHERING_KEY FILE_TO_CIPHER
positional arguments:
optional arguments:
Decipher a text using a key.
| $ cifra decipher ALGORITHM_NAME CIPHERING_KEY FILE_TO_DECIPHER
positional arguments:
optional arguments:
Attack a ciphered text to get its plain text.
| $ cifra attack ALGORITHM_NAME FILE_TO_ATTACK
positional arguments:
optional arguments:
Currently these algorithms are available:
Report issues at: https://github.com/dante-signal31/cifra-rust/issues
To install Cifra refer to its installation instructions: https://github.com/dante-signal31/cifra/wiki/Installation
Dante Signal31 dante.signal31@gmail.com
Website: https://github.com/dante-signal31/cifra-rust
Copyright (c) 2021 Dante-Signal31 dante.signal31@gmail.com. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or
promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.