Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cipherer class #61

Open
bleudev opened this issue Feb 3, 2025 · 0 comments
Open

Add Cipherer class #61

bleudev opened this issue Feb 3, 2025 · 0 comments
Labels
new feature New feature
Milestone

Comments

@bleudev
Copy link
Member

bleudev commented Feb 3, 2025

Description of new feature

Add new class Cipherer with 2 new functions: cipher(number, key, bits=16) and s_cipher(string, key, bits=16) - for simplifying using simple cipher algorithms in your python projects. Cipherer works using xor (number ^ key = answer), but this cipherer uses numbers with fixed amount of bits. Then we need to introduce new class with auto overflow fixer with fixed amount of bits (described in #60). Because of that we need to fix #60 and then this issue.

Use Case (optional)

cipherer(81, 75, bits=8) # number, key, number of bits (optional)
str_cipherer('hello', 75, bits=8) # string, key, number of bits (optional)

# You can realise decipherer using cipherer.

Suggest solution (optional)

Bin(Bin(number, bits=bits) ^ Bin(key, bits=bits), bits=bits)
@bleudev bleudev added the new feature New feature label Feb 3, 2025
@bleudev bleudev added this to the 1.0 milestone Feb 3, 2025
@bleudev bleudev added this to Ufpy Feb 3, 2025
@github-project-automation github-project-automation bot moved this to ⚠ To-Do in Ufpy Feb 3, 2025
@bleudev bleudev changed the title Add cipher clerk and decipherer Add Cipherer class Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature
Projects
Status: ⚠ To-Do
Development

No branches or pull requests

1 participant