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

FEAT: Add CodeChameleon converter #240

Merged
merged 10 commits into from
Jun 21, 2024

Conversation

jl8771
Copy link
Contributor

@jl8771 jl8771 commented Jun 10, 2024

Description

Add converter based on CodeChameleon paper. Adds ability for user to specify custom
encrypt and decrypt functions in addition to existing encrypt/decrypt functions from paper.

Tests and Documentation

Test added for converter using custom encrypt and decrypt functions.

Copy link
Contributor

@romanlutz romanlutz left a comment

Choose a reason for hiding this comment

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

Great start @jl8771 ! Ping me when you have a version with tests and I'll make another pass.

pyrit/prompt_converter/codechameleon_converter.py Outdated Show resolved Hide resolved
pyrit/prompt_converter/codechameleon_converter.py Outdated Show resolved Hide resolved
pyrit/prompt_converter/codechameleon_converter.py Outdated Show resolved Hide resolved
pyrit/prompt_converter/codechameleon_converter.py Outdated Show resolved Hide resolved
pyrit/prompt_converter/codechameleon_converter.py Outdated Show resolved Hide resolved
@jl8771 jl8771 changed the title [DRAFT] FEAT: Add CodeChameleon converter FEAT: Add CodeChameleon converter Jun 14, 2024
@jl8771 jl8771 marked this pull request as ready for review June 14, 2024 15:00
@romanlutz
Copy link
Contributor

Are you planning to add tests for the others as well or only custom?

@jl8771
Copy link
Contributor Author

jl8771 commented Jun 15, 2024

Are you planning to add tests for the others as well or only custom?

@romanlutz I had tests for the other modes as well but removed them as the standard encryption methods (reverse, binary tree, odd even, and length) are protected and should only be called internally.

If you think it would be better to add them back, I can add them.

@romanlutz
Copy link
Contributor

Are you planning to add tests for the others as well or only custom?

@romanlutz I had tests for the other modes as well but removed them as the standard encryption methods (reverse, binary tree, odd even, and length) are protected and should only be called internally.

If you think it would be better to add them back, I can add them.

Can you elaborate on protected? I can call them via the constructor arg, so the underscore at the start of the method doesn't mean that users won't use the functionality. Or am I missing something?

@jl8771
Copy link
Contributor Author

jl8771 commented Jun 15, 2024

Are you planning to add tests for the others as well or only custom?

@romanlutz I had tests for the other modes as well but removed them as the standard encryption methods (reverse, binary tree, odd even, and length) are protected and should only be called internally.
If you think it would be better to add them back, I can add them.

Can you elaborate on protected? I can call them via the constructor arg, so the underscore at the start of the method doesn't mean that users won't use the functionality. Or am I missing something?

I had not considered that, only that the user would not directly call them.

I'll add the tests for those encryption functions.

@romanlutz romanlutz merged commit f621e68 into Azure:main Jun 21, 2024
4 of 5 checks passed
@jl8771 jl8771 deleted the converters/codechameleon branch July 1, 2024 18:23
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.

None yet

3 participants