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

๐Ÿ“ก 
Detailed Features & Functions Guide
Welcome to the comprehensive breakdown of e-N-c-R-y-P-t! 

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

๐Ÿ”ง Core Functions
------------------

1. **sha256** ๐Ÿ”
   - ๐Ÿงฉ Hashes a given string using the SHA-256 algorithm.
   - ๐Ÿงช Utilizes OpenSSL's EVP API.
   - ๐Ÿงพ Returns the hash as a hexadecimal string.

2. **loadAllowedHashes** ๐Ÿ“ฅ
   - ๐Ÿ“‚ Loads allowed peer IPs from allowed_hashes.txt.
   - ๐Ÿงพ Returns a set of allowed IPs.

3. **loadTrustedHashes** ๐Ÿ”’
   - ๐Ÿ“‚ Loads trusted peer hashes from trusted_hashes.txt.
   - ๐Ÿงพ Returns a set of trusted hashes.

4. **appendTrustedHash** โž•
   - ๐Ÿ“ Appends a new trusted hash to trusted_hashes.txt.
   - ๐Ÿ›ก๏ธ Ensures trusted peers are recorded.

5. **isAllowedPeerIP** โœ…
   - ๐Ÿ” Checks if a peer's IP is in the allowed list.
   - ๐Ÿงพ Returns true if allowed, false otherwise.

6. **isTrustedPeerIP** ๐Ÿ›ก๏ธ
   - ๐Ÿ” Checks if a peer's IP is trusted.
   - ๐Ÿงพ If not trusted, hashes the IP and appends it to the trusted list.
   - ๐Ÿงพ Returns true if trusted, false otherwise.

7. **human_readable_bytes** ๐Ÿ“Š
   - ๐Ÿ”ข Converts byte count to a human-readable format (e.g., KB, MB).
   - ๐Ÿงพ Returns a formatted string.

8. **is_singleton** ๐Ÿšซ
   - ๐Ÿ”’ Ensures only one instance of the application runs at a time.
   - ๐Ÿงพ Returns true if single instance, false otherwise.

9. **log_stats** ๐Ÿ“ˆ
   - ๐Ÿ•’ Logs statistics to stats.log.
   - ๐Ÿ“Š Includes data on banned IPs, TLS connections, traffic, and packets.
   - ๐Ÿ”„ Resets stats after each log.

10. **to_upper** ๐Ÿ” 
    - ๐Ÿ”ค Converts a string to uppercase.
    - ๐Ÿงพ Returns the uppercase string.


๐Ÿ“Š Stats Structure
-------------------------
- ๐Ÿงฎ Tracks:
  - ๐Ÿšซ banned_ips: Number of banned IPs.
  - ๐Ÿ”“ nonTlsAttemptsCount: Number of non-TLS attempts.
  - ๐Ÿ” tlsConnections: Number of TLS connections.
  - ๐Ÿ“ฅ bytes_rx: Bytes received.
  - ๐Ÿ“ค bytes_tx: Bytes transmitted.
  - ๐Ÿ“ฆ packets_rx: Packets received.
  - ๐Ÿ“ฆ packets_tx: Packets transmitted.
- ๐Ÿ”„ Resets every 1 minute after logging.


๐Ÿ“ Configuration Files
-----------------------
- **allowed_hashes.txt** โœ…
  - ๐Ÿ“„ Lists allowed peer IPs.
- **trusted_hashes.txt** ๐Ÿ”
  - ๐Ÿ“„ Stores trusted peer hashes.
- **stats.lock** ๐Ÿ”’
  - ๐Ÿ“„ Ensures a single instance of the application.
- **stats.log** ๐Ÿ“ˆ
  - ๐Ÿ“„ Logs 1 minute statistics.
  

๐Ÿ”„ Logging & Monitoring
------------------------
- ๐Ÿ•’ Logs statistics every 1 minute.
- ๐Ÿ“Š Includes data on:
  - ๐Ÿšซ Banned IPs
  - ๐Ÿ”“ Non-TLS attempts
  - ๐Ÿ” TLS connections
  - ๐Ÿ“ฅ Received traffic
  - ๐Ÿ“ค Transmitted traffic
  - ๐Ÿ“ฆ Received packets
  - ๐Ÿ“ฆ Transmitted packets
- ๐Ÿ“‚ Logs to stats.log for monitoring.


โš ๏ธ Notes
---------
- ๐Ÿ” Utilizes OpenSSL's SHA-256 for hashing.
- ๐Ÿ”„ Ensures only one instance runs at a time using stats.lock.
- ๐Ÿ“Š Logs detailed statistics to stats.log.
- ๐Ÿงพ Requires allowed_hashes.txt and trusted_hashes.txt for operation.

Made with โค๏ธ in ๐Ÿ‡ธ๐Ÿ‡ฐ