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

Added AES Encryption with Cipher Block Chaining to Payment Method Details #755

Merged
merged 5 commits into from
Nov 4, 2024

Conversation

IkkiOcean
Copy link
Contributor

This PR introduces AES encryption with Cipher Block Chaining (CBC) mode to the payment method details in the application. The changes enhance the security of sensitive payment information by encrypting data such as card numbers and holder names before storing them in the database.

Changes Made

  1. Updated Payment Method Schema:

    • Modified the payment method schema to accommodate encrypted fields.
    • The details field now stores encrypted card information, including:
      • cardNumber
      • lastFour
      • expiry
      • holderName
    • Each field is encrypted and stored with its respective Initialisation vector (IV).
  2. Refactored Profile Controllers:

    • Updated profile controllers to handle the new payment method schema.
    • Implemented encryption logic using AES in CBC mode before saving payment details to the database.
    • Decryption logic was also added when retrieving payment methods to ensure that sensitive data is only visible in its decrypted form when needed.
  3. Updated Frontend Payment Method Forms:

    • Refactored payment method forms to align with the new schema and data handling.
    • Ensured that all fields related to card details are processed correctly, and added functionality to format expiry dates appropriately.
    • Implemented a modern design for the select dropdowns to enhance user experience.

Notes

  • The implementation uses AES encryption in CBC mode to ensure data confidentiality and integrity.
  • Please ensure that the encryption keys and IVs are managed securely.
  • Make sure to put secret key in .env before deploying.

Related Issues

Video

abes.mp4

Copy link

vercel bot commented Nov 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agro-tech-ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 4, 2024 5:40am

Copy link
Contributor

github-actions bot commented Nov 3, 2024

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

@manikumarreddyu manikumarreddyu merged commit 6f59961 into manikumarreddyu:main Nov 4, 2024
3 checks passed
Copy link
Contributor

github-actions bot commented Nov 4, 2024

🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. Your efforts are greatly appreciated. Feel free to reach out if you have any more contributions or if there's anything else we can assist you with. Keep up the fantastic work! 🚀

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

Successfully merging this pull request may close these issues.

[Feature Request]: Adding AES encryption with a 32-bit key(Cipher Block Chaining) to payment mode data
2 participants