Network Proof of work on login.

Networking:
Packet: {Packetsize,,EncrCheck,Checksum}
if encCheck is empty, packet is unencrypted.
If EncCheck populated, then padding and Payload is encrypted, Decrypt and check valididty.

Packing:
    Encrypted:
        Create payload, Add random Padding.
        Encrypt And create SaltHash->EncrCheck
        Calculate Packetsize +(empty checksum) -> Packetsize
        Calculate Checksum-> Checksum
        Send
    NonEncrypted:
        Create Payload, Add 0000 Padding (Important)
        Calculate Packetsize +(empty checksum) -> Packetsize
        Calculate Checksum-> Checksum

Unpack:
        Check PacketSize.
        Check Checksum.
        Check EncCheck.
            Encrypted?
                Decrypt
        Ignore Padding. and process.

Authentication:
INFO:
(Ring 0)(unencrypted)
(Ring 1)(Using public/private key for encryption)
(Ring 2)(Using Shared key)

Hello Servers:
    (Ring 0)
    >Hello Port.
    //Has IP Hellod in last 5 seconds?
    (Yes)->Dissconect -FLAG {DDOS}
    =Ask authentication server for Public key.
    <Port gives you Another IP+Port and a Public Key.
    =Dissconnect

Authentication Server:
    (RING 1)
    >Hello to server with My Public Key 
    //Has IP Hellod in last 1 minutes?.
    (yes)->Dissconnect
    <Port sends chalenge
    >Respond with chalenge awnser.
    //Is chalenge good?
    (no)->Dissconnect
    <Port asks Username
    >You send username
    //Is Username Good? 
    (No)->Dissconnect.
    <Port asks Password, and gives PublicSalt for that UserName
    >You Send PublicSaltedPassword And Requested Service.
    //Add with PrivateSalt
    //Is password Hash Correct?
    (No)->Dissonnect
    //Ask Application Server(Service) for a Lease provide: {Username,OriginIP}
    =Server gets lease from node: Lease{LeaseID,Shared Key,IP,Port,Durration}
    <Port passes lease down to Client.
    =Dissconnect.

Application Servers:
    (Ring 0)
    >Hello port with LeaseId
    //Is lease valid?
    (No)->Send error and dissconnect
    //Is lease from correct ip?
    (No)->Send error and dissconnect
    =Load Key (Shared Key)
    (Ring 1)
    <Send Hello {Username} back.