Skip to content

Adding functions for Decrypt sequence on API server#173

Merged
avalerio-tkd merged 4 commits into
mainfrom
av_sequncer_decryption_07
Dec 2, 2025
Merged

Adding functions for Decrypt sequence on API server#173
avalerio-tkd merged 4 commits into
mainfrom
av_sequncer_decryption_07

Conversation

@avalerio-tkd

Copy link
Copy Markdown
Collaborator
  • Add the header of methods for the Decryption sequence.
  • Reorganized the code to group related methods together.

- Reorganized the code to group related methods together.
// Decompress the encrypted bytes
auto decompressed_encrypted_bytes = Decompress(ciphertext, encrypted_compression_);

// Decrypt the typed list and level bytes

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.

technically we need the Type of the column in here (so we know how to make sense of the decrypted bytes for each value) - but that can wait for a later iteration. This is good for demo/discussion purposes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this will be passed along the rest of the "context" to the implementation (column_name, user_id, key_id, application_context). This DecryptTypedList is a helper method inside the class that assembles the call to the encrypt/decrypt with all the params.

return true;
}

std::string DataBatchEncryptionSequencer::ValidateDecryptionVersion() {

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.

nit/question: I remember seeing this code in another PR - let's make sure it's not duplicate.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this was moved from ConvertAndDecrypt to here for readabilty.

Comment thread src/server/encryption_sequencer.cpp Outdated
return "";
}

std::string DataBatchEncryptionSequencer::SafeGetEncryptionMode() {

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.

can we consider using an optional, rather than an empty string to signal 'error'?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done. Thanks.

@argmarco-tkd argmarco-tkd 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.

thanks for this. Overall LGTM. Left a few comments, but none which are red flags/blockers for demo/discussion

…gent to facilitate testing.

- Removed VALID_ENCRYPTION_METADATA constant from dbpa_remote_testapp.cpp to use the real one returned from the encryption result.
@avalerio-tkd avalerio-tkd merged commit dfad7e6 into main Dec 2, 2025
2 checks passed
@avalerio-tkd avalerio-tkd deleted the av_sequncer_decryption_07 branch December 2, 2025 17:11
@avalerio-tkd

Copy link
Copy Markdown
Collaborator Author

#174

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