Giter Site home page Giter Site logo

rsa-encryption-framework's Introduction

RSA Encryption Framework

Introduction

Welcome to the RSA Encryption Framework! This framework provides a simple API for RSA encryption and decryption, allowing users to easily integrate RSA cryptography into their applications. The framework includes three main APIs: one to retrieve the public certificate, one to encrypt plaintext, and one to decrypt an encrypted Base64 string.

You can run the application and start swagger using http://localhost:5000/encryption/swagger-ui/index.html#/

Getting Started

To use the RSA Encryption Framework, follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/your-username/rsa-encryption-framework.git
  2. Open the application.properties file in the project and configure the public and private keys:

    # RSA Keys Configuration
    app.encryption.publicKeys.key001=YOUR_PUBLIC_KEY_HERE
    app.encryption.privateKeys.key001==YOUR_PRIVATE_KEY_HERE

    Replace YOUR_PUBLIC_KEY_HERE and YOUR_PRIVATE_KEY_HERE with your actual public and private RSA keys.

  3. Build and run the application:

    ./mvnw spring-boot:run

    The application will start, and you can access the APIs described below.

API Endpoints

1. Get Public Certificate

  • Endpoint: /v1/cert
  • Method: GET
  • Description: Retrieves the public certificate used for RSA encryption.
  • Example Request:
    curl http://localhost:8080/v1/cert

2. Encrypt Plaintext

  • Endpoint: /v1/encrypt
  • Method: POST
  • Description: Encrypts plaintext and returns the encrypted Base64 string.
  • Request Body:
    {
      "plaintext": "Hello, RSA!"
    }
  • Example Request:
    curl -X POST -H "Content-Type: application/json" -d '{"plaintext": "Hello, RSA!"}' http://localhost:8080/v1/encrypt

3. Decrypt Encrypted Base64 String

  • Endpoint: /v1/decrypt
  • Method: POST
  • Description: Decrypts an encrypted Base64 string and returns the plaintext.
  • Request Body:
    {
      "encryptedBase64String": "ENCRYPTED_BASE64_STRING_HERE"
    }
  • Example Request:
    curl -X POST -H "Content-Type: application/json" -d '{"encryptedBase64String": "ENCRYPTED_BASE64_STRING_HERE"}' http://localhost:8080/v1/decrypt

Note

Make sure to handle and store your private key securely. Do not expose it in the source code or share it publicly.

Feel free to explore and integrate the RSA Encryption Framework into your projects! If you encounter any issues or have suggestions for improvement, please open an issue on the GitHub repository.

Happy encrypting!

rsa-encryption-framework's People

Contributors

yash-gaglani avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.