Simplify and Refactor Asymmetric Encryption/Decryption #10

Merged
MahmoudEmad merged 3 commits from development_fix_code into main 2025-05-13 13:00:16 +00:00
Member

Description

This PR introduces a set of changes to improve the structure, readability, and functionality of the asymmetric encryption and keypair management logic. Specifically, it simplifies the ECIES-based encryption scheme and improves modularity in Ethereum wallet handling.

Changes

  • Refactor keypair and Ethereum wallet handling

    • Moved prepare_function_arguments and convert_token_to_rhai to the ethereum module for better organization.
    • Updated keypair module to use the new session_manager structure for improved clarity.
    • Replaced old KeyPair references with vault::keyspace::keypair_types::KeyPair.
    • Enhanced error handling in EthereumWallet methods.
  • 🛠️ Fix build errors

    • Resolved type mismatches between ecdsa::VerifyingKey and k256::elliptic_curve::PublicKey.
    • Ensured compatibility between encryption/decryption logic and ECDH-based shared secret derivation.
  • Simplify asymmetric encryption/decryption

    • Refactored to use a single symmetric key encrypted with the recipient’s public key.
    • Reduced unnecessary complexity from ephemeral key handling.
    • Improved test coverage and documentation.
### Description This PR introduces a set of changes to improve the structure, readability, and functionality of the asymmetric encryption and keypair management logic. Specifically, it simplifies the ECIES-based encryption scheme and improves modularity in Ethereum wallet handling. ### Changes * ✅ **Refactor keypair and Ethereum wallet handling** * Moved `prepare_function_arguments` and `convert_token_to_rhai` to the `ethereum` module for better organization. * Updated `keypair` module to use the new `session_manager` structure for improved clarity. * Replaced old `KeyPair` references with `vault::keyspace::keypair_types::KeyPair`. * Enhanced error handling in `EthereumWallet` methods. * 🛠️ **Fix build errors** * Resolved type mismatches between `ecdsa::VerifyingKey` and `k256::elliptic_curve::PublicKey`. * Ensured compatibility between encryption/decryption logic and ECDH-based shared secret derivation. * ✨ **Simplify asymmetric encryption/decryption** * Refactored to use a single symmetric key encrypted with the recipient’s public key. * Reduced unnecessary complexity from ephemeral key handling. * Improved test coverage and documentation.
MahmoudEmad added 3 commits 2025-05-13 11:46:54 +00:00
refactor: Refactor keypair and Ethereum wallet handling
Some checks are pending
Rhai Tests / Run Rhai Tests (push) Waiting to run
25f2ae6fa9
- Moved `prepare_function_arguments` and `convert_token_to_rhai` to the `ethereum` module for better organization.
- Updated `keypair` module to use the new `session_manager` structure improving code clarity.
- Changed `KeyPair` type usage to new `vault::keyspace::keypair_types::KeyPair` for consistency.
- Improved error handling and clarity in `EthereumWallet` methods.
feat: Simplify asymmetric encryption/decryption
Some checks are pending
Rhai Tests / Run Rhai Tests (pull_request) Waiting to run
7add64562e
- Simplify asymmetric encryption by using a single symmetric key
  instead of deriving a key from an ephemeral key exchange.  This
  improves clarity and reduces complexity.
- The new implementation encrypts the symmetric key with the
  recipient's public key and then encrypts the message with the
  symmetric key.
- Improve test coverage for asymmetric encryption/decryption.
MahmoudEmad changed title from development_fix_code to Simplify and Refactor Asymmetric Encryption/Decryption 2025-05-13 11:49:44 +00:00
MahmoudEmad merged commit 0c425470a5 into main 2025-05-13 13:00:16 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: herocode/sal#10
No description provided.