Giter Club home page Giter Club logo

socketcrypt's Introduction

SocketCrypt

SocketCrypt is a comprehensive Java library designed to facilitate secure communication over sockets. It provides a set of classes that enable developers to encrypt and decrypt data transmitted over these sockets. The library leverages the robust security of the RSA algorithm for secure key exchange, ensuring that the keys used for data encryption and decryption are securely exchanged between the communicating parties.

For the actual data encryption and decryption, SocketCrypt employs the Advanced Encryption Standard (AES). AES is a symmetric encryption algorithm that is widely recognized for its high level of security. It is used to encrypt the data before it is sent over the socket, and then decrypt it upon receipt. This ensures that even if the data is intercepted during transmission, it remains unreadable without the correct decryption key.

In essence, SocketCrypt is a powerful tool for developers looking to implement secure socket communication in their Java applications. It provides a simple and effective solution for encrypting and decrypting data, making it easier to build secure network applications.

client:

server:

Features

  • Secure communication over sockets
  • RSA key exchange for secure communication
  • AES data encryption

Installation

To use SocketCrypt in your project, add the following to your pom.xml file:


Usage

SocketCryptClient

The SocketCryptClient class extends the Socket class and provides methods for sending and receiving encrypted messages.

public class Main {
    public static void main(String[] args) throws IOException {
        SocketCryptClient s = new SocketCryptClient("localhost",6548);
        s.sendMessage("hello encrypted server");
        s.getMessage();
    }
}

SocketCryptServer

The SocketCryptServer class provides methods for sending and receiving encrypted messages.

public class MainServer {

    public static void main(String[] args) throws IOException {
        try (ServerSocket serverSocket = new ServerSocket(6548)) {
            Socket clientSocket = serverSocket.accept();
            SocketCryptServer s = new SocketCryptServer(clientSocket);
            System.out.println("Client connected." + clientSocket.getLocalSocketAddress());
            s.getMessage();
            s.sendMessage("hi encrypted client");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}

UML

Contributing

Contributions are welcome! Please feel free to submit a pull request.

License

SocketCrypt is released under the MIT License. See the LICENSE file for more details.

socketcrypt's People

Contributors

seyed0123 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.