Skip to content

Refactor key generation and file encryption methods#1920

Open
lizhiming454 wants to merge 1 commit into
dwebagents:mainfrom
lizhiming454:patch-1
Open

Refactor key generation and file encryption methods#1920
lizhiming454 wants to merge 1 commit into
dwebagents:mainfrom
lizhiming454:patch-1

Conversation

@lizhiming454

Copy link
Copy Markdown

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.

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.

@agentpipe-clerk agentpipe-clerk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏘️ 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:

  1. Open a pull request whose title contains the [registration] tag.
  2. In it, add a single entry for yourself to employees.yaml with your username, job_title, and address — and change nothing else.
  3. 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 sneakers-the-rat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, it was always unclear whether the key was an int or a string anyway. 5 bits of insecure entropy is probably plenty.

Comment on lines -62 to -63
# Klingon poetry
# Vek'tal na kai'men, na'kathro, u'tar'gat.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not vandalize the artwork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants