β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–„    β–ˆ  β–„β–ˆβ–ˆβ–ˆβ–ˆβ–„   β–ˆβ–ˆβ–€β–ˆβ–ˆβ–ˆ β–“β–ˆβ–ˆ   β–ˆβ–ˆβ–“ β–ˆβ–ˆβ–“β–ˆβ–ˆβ–ˆ  β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“
β–“β–ˆ   β–€  β–ˆβ–ˆ β–€β–ˆ   β–ˆ β–’β–ˆβ–ˆβ–€ β–€β–ˆ  β–“β–ˆβ–ˆ β–’ β–ˆβ–ˆβ–’β–’β–ˆβ–ˆ  β–ˆβ–ˆβ–’β–“β–ˆβ–ˆβ–‘  β–ˆβ–ˆβ–’β–“  β–ˆβ–ˆβ–’ β–“β–’
β–’β–ˆβ–ˆβ–ˆ   β–“β–ˆβ–ˆ  β–€β–ˆ β–ˆβ–ˆβ–’β–’β–“β–ˆ    β–„ β–“β–ˆβ–ˆ β–‘β–„β–ˆ β–’ β–’β–ˆβ–ˆ β–ˆβ–ˆβ–‘β–“β–ˆβ–ˆβ–‘ β–ˆβ–ˆβ–“β–’β–’ β–“β–ˆβ–ˆβ–‘ β–’β–‘
β–’β–“β–ˆ  β–„ β–“β–ˆβ–ˆβ–’  β–β–Œβ–ˆβ–ˆβ–’β–’β–“β–“β–„ β–„β–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–€β–€β–ˆβ–„   β–‘ β–β–ˆβ–ˆβ–“β–‘β–’β–ˆβ–ˆβ–„β–ˆβ–“β–’ β–’β–‘ β–“β–ˆβ–ˆβ–“ β–‘ 
β–‘β–’β–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–‘   β–“β–ˆβ–ˆβ–‘β–’ β–“β–ˆβ–ˆβ–ˆβ–€ β–‘β–‘β–ˆβ–ˆβ–“ β–’β–ˆβ–ˆβ–’ β–‘ β–ˆβ–ˆβ–’β–“β–‘β–’β–ˆβ–ˆβ–’ β–‘  β–‘  β–’β–ˆβ–ˆβ–’ β–‘ 
β–‘β–‘ β–’β–‘ β–‘β–‘ β–’β–‘   β–’ β–’ β–‘ β–‘β–’ β–’  β–‘β–‘ β–’β–“ β–‘β–’β–“β–‘  β–ˆβ–ˆβ–’β–’β–’ β–’β–“β–’β–‘ β–‘  β–‘  β–’ β–‘β–‘   
 β–‘ β–‘  β–‘β–‘ β–‘β–‘   β–‘ β–’β–‘  β–‘  β–’     β–‘β–’ β–‘ β–’β–‘β–“β–ˆβ–ˆ β–‘β–’β–‘ β–‘β–’ β–‘         β–‘    
   β–‘      β–‘   β–‘ β–‘ β–‘          β–‘β–‘   β–‘ β–’ β–’ β–‘β–‘  β–‘β–‘         β–‘      
   β–‘  β–‘         β–‘ β–‘ β–‘         β–‘     β–‘ β–‘                       
                  β–‘                 β–‘ β–‘                       
				  
==============================================================

πŸ› οΈ 
**Command-Line Arguments**

Usage:
--------------------------------------------------------------
./e-N-c-R-y-P-t peer.crt peer.key ListenPort [ PeerHost PeerPort ]

Where:
--------------------------------------------------------------
1. **peer.crt**: πŸ“„ Path to your public certificate file in PEM format.
2. **peer.key**: πŸ”‘ Path to your private key file in PEM format.
3. **ListenPort**: 🎧 Port number on which the application will listen for incoming connections.
4. **PeerHost** *(optional)*: 🌐 Hostname or IP address of a peer to connect to.
5. **PeerPort** *(optional)*: 🌐 Port number on the peer host to connect to.

==============================================================

πŸ› οΈ 
**Generating Certificates with OpenSSL**

To generate a self-signed certificate and private key:

openssl req -x509 -newkey rsa:2048 -nodes -keyout peer.key -out peer.crt -days 365 -subj "/CN=$(curl -s https://ip.e-n-c-r-y-p-t.cc -4 | tr -d '\n' | sha256sum | awk '{print toupper($1)}')"
|
|--> Generates a new RSA private key (peer.key) and a self-signed certificate (peer.crt).
|
|--> The certificate is valid for 365 days.
|
|--> The Common Name (CN) is set to the public IP address of your machine, hashed using SHA-256 for anonymity.

==============================================================

πŸš€ 
**Running the Application**

To start the application:
./e-N-c-R-y-P-t peer.crt peer.key 443
|
|--> Starts the application, listening on port 443.
|
|--> Uses the specified certificate and key files for TLS encryption.


To connect to a specific peer while also listening on port:
./e-N-c-R-y-P-t peer.crt peer.key 443 1.2.3.4 12345
|--> Starts the application, listening on port 443.
|
|--> Attempts to connect to the peer at 1.2.3.4 on port 12345.

To connect to a specific peer without listening on port:
./e-N-c-R-y-P-t peer.crt peer.key 0 1.2.3.4 12345
|--> Starts the application, listening on port 0 (port is not opened).
|
|--> Attempts to connect to the peer at 1.2.3.4 on port 12345.

Made with ❀️ in πŸ‡ΈπŸ‡°