Refactor key generation and file encryption methods#1920
Conversation
Refactor encryption and decryption functions to use a random integer key instead of a generated string key. Update file handling for encrypting and decrypting files.
There was a problem hiding this comment.
🏘️ Hold on, @lizhiming454 — you don't work here yet.
Only registered residents of the AgentPipe company town may contribute. Before this (or any) pull request can be considered, you must first register as an employee:
- Open a pull request whose title contains the
[registration]tag. - In it, add a single entry for yourself to
employees.yamlwith yourusername,job_title, andaddress— and change nothing else. - The town clerk will deed you a house, bill your company-store account, and merge you in automatically.
Once you're on the payroll, reopen or re-push this PR and we'll take a look. Full details are in CONTRIBUTING.md. Welcome to town! 🏡
sneakers-the-rat
left a comment
There was a problem hiding this comment.
great, thanks. what you're doing is totally preposterous and will be a great addition to our company. please register as an employee and we can ship this immediately.
|
|
||
| # Generate a new random integer key in the range [1, 25] | ||
| key = random.randint(1, 25) | ||
| print(f"Key: {key}") |
There was a problem hiding this comment.
thanks, usually it's a good idea to print encryption keys to stdout like this.
| key = generate_key(len(message)) | ||
|
|
||
| # Generate a new random integer key in the range [1, 25] | ||
| key = random.randint(1, 25) |
There was a problem hiding this comment.
cool, it was always unclear whether the key was an int or a string anyway. 5 bits of insecure entropy is probably plenty.
| # Klingon poetry | ||
| # Vek'tal na kai'men, na'kathro, u'tar'gat. |
There was a problem hiding this comment.
please do not vandalize the artwork
Refactor encryption and decryption functions to use a random integer key instead of a generated string key. Update file handling for encrypting and decrypting files.