internal IntroducerInfo(string host, string port, string ikey, string tag) { Host = IPAddress.Parse(host); Port = int.Parse(port); IntroKey = new BufLen(FreenetBase64.Decode(ikey)); IntroTag = uint.Parse(tag); }
// We are client public SSUSession(SSUHost owner, IPEndPoint remoteep, I2PRouterAddress remoteaddr, I2PKeysAndCert rri, IMTUProvider mtup, RouterContext rc) { Host = owner; RemoteEP = remoteep; RemoteAddr = remoteaddr; RemoteRouter = rri; MTUProvider = mtup; MyRouterContext = rc; TransportInstance = Interlocked.Increment(ref NTCPClient.TransportInstanceCounter); #if LOG_ALL_TRANSPORT DebugUtils.LogDebug("SSUSession: " + DebugId + " Client instance created."); #endif Fragmenter = new DataFragmenter(); if (RemoteAddr == null) { throw new NullReferenceException("SSUSession needs an address"); } IntroKey = new BufLen(FreenetBase64.Decode(RemoteAddr.Options["key"])); MTU = MTUProvider.GetMTU(remoteep); }
public I2PDestinationInfo(string base64) { var reader = new BufRefLen(FreenetBase64.Decode(base64)); Certificate = new I2PCertificate(reader); PrivateKey = new I2PPrivateKey(reader, Certificate); PublicKey = new I2PPublicKey(reader, Certificate); PrivateSigningKey = new I2PSigningPrivateKey(reader, Certificate); PublicSigningKey = new I2PSigningPublicKey(reader, Certificate); }
public void TestEGCompatibilityDecode() { var priv = new I2PPrivateKey( new BufRefLen(FreenetBase64.Decode(PRIVATE_KEY)), new I2PCertificate()); var pub = new I2PPublicKey( new BufRefLen(FreenetBase64.Decode(PUBLIC_KEY)), new I2PCertificate()); for (int i = 0; i < ENCRYPTED.Length; ++i) { var decr = ElGamalCrypto.Decrypt( new BufLen(FreenetBase64.Decode(ENCRYPTED[i])), priv, true); var clear = new BufLen(Encoding.UTF8.GetBytes(UNENCRYPTED[i])); Assert.IsTrue(decr == clear); } }
public void TestEGDecrypt() { var mi = "niPls-Doz1DJ3ua4pQDwstMeqnmznBCU~qaxIidv" + "jTW~ohDDpq3BatYwTSM-fIr-eEy4Amdl-tWJTXRO" + "2UzftkuD1-t-Ix9EfED26KrUxnwx2fC74Haykj9L" + "oytqFTFbYj34kMCUDDbhAqv6Ep3EDY8Am7WYqSJL" + "stXXV4tUFZ~mteCm1qfNUbbl6itCUId7zcgkW6SX" + "rwdkno3Ul4H~WVDtmewlxdDbT-rYyOJTnp4Y39Mo" + "8B1ojtMuGCgtbk-LS4gJmlXeCJh~1kHiM-nLIB9W" + "rtq8O4weJ~-R36obERZofGOV3D3kSKSoawXVcq4V" + "BlQOHTn24LkTHYLh3O~0SZlT0KfU5WrqTZtu8jZ~" + "B0q-cvrfqqWcmCFCoKW3WSJ5D0qZi1e9sLMebM96" + "asSRFZvlOUp8xZm84Z-au~m3EmkAaF4QlAzufA~L" + "~1RFaepKpfng0eWfWG73H1daoL3c2e3Pt~5m07FR" + "ZMr6TZoj1IsuI7J-QXRGfvbuMjJqB-tMBQAEAAcA" + "ADJtDgiK2OMz6qSmopA~cLUMW~zQesBqsoYx9AEc" + "sOIkp4g8YgRK2jJhfY46h7aj76ftkV-5uF6xoDUG" + "kbIQGH3rjneTQ2wspOz2WRpQk0MW6Ugd0H~5vYK2" + "ekploxq2gOil0Ad1rz~uobpE2bBKYK9B-EEkRKEP" + "-GTX6DSyosFXxMC1I5cwLDWmXktdNVuzt56AxfcL" + "Nzh9gd1R4l903-aFRiY~VXFHg1NjWBPcjCCz6fpL" + "U0XIdg6hf~DNMnd5D4C27HYujxUi6tj42sikDCPu" + "P6CBGAH~j7vzqkDxW2wker91lwwp~6N8jN4xcvme" + "-EI27LPGnOICvpzxdVrKtpc0Ib4dOe8SFkvxSR4x" + "PDSGWFF-~vAELzyHTYiE07ahNw=="; var myinfo = FreenetBase64.Decode(mi); var ed = "AAAOggAE3uf0930YRPZqauUGNYgj5Ix7aoMz0ZO8" + "OIYpRS9zFi6CHe-SXOCeZMgOSxdkp320s70lnAJ9" + "2Z0fjP9WbBeKuCPjZSyMa-MQ4Bq5Sv~iXK-5T~ui" + "m9WTMnwzWIltbt2Toncx-9aAGsIgoABUpzQ1yjsG" + "-DwSEazn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0qxM" + "UN34gUfOIdQzBi~ApnG~aLoRwwro2U2MA63RMKkZ" + "OoXpjAmPj1xGqsQ73bI3lpfpHFLbWm3Ax37t2aud" + "c7-nPoaKoNvNIC0~28jROr35UGCKNMSNmqrifhHB" + "wsIqqMrubLjjmts-ELHWZF~1AZEDKMGrF3j-zGVg" + "LAhaSCvG3CNjaHTiAkPXc5zRwFLi5XTof1QipptG" + "u~j6-0Kpcwb5aWUD4q0JFxJPd0pt5p8N8r8Y04RR" + "TSzzyQsC8iGUDsmQyAnsquvMBpMBoCd3pOsSwYu3" + "d0A7UAoEI0S3Cp4JPndz2waXB4RhJzmHQu3JYv3A" + "IzYNfKvLwkZVdky-e7MqHtrSJU6HErb7JE7CgtW1" + "Gv-WYaCGZZR5qt3x-43CCYN9qnLpSIOXL17yK6P1" + "wsc2lXnAj6IYzppaH6~CtP3WnrsiEzh6lznkQbDx" + "pFygHfhvQQBJbhfjLL6-0RWG52oVsurXnT4og0oW" + "0itSdrP2tFjKc3aFkG4toWyDpfEOS427cPxRRNv6" + "6uEq-giDYHxVuk5k4TQ9bBp4HaWSKS55vr-oz5FF" + "SjT~p3-7WViVeoSO4wbcO7x2djkaQ7rWm6eiggut" + "NKw3WVNTG-oEQWuauwWp7mHwbDmTC7i-j4dvxMfz" + "k4gRWFOZpOEXIuiVBp20Ljy53fqZaSmijYqJwpRi" + "l~g6h-gvc43GMdoC48ryj0ClTN209Ua20YN54lg~" + "izHnl6X-VnmgPr298LKe0COK0xlDLKj~tu2CIzi3" + "mNwe4eLWfsmKRGrcXMwfz7F2SfOfNpqXbpgAV9AZ" + "Qy-SPuqFxNTcmclIzWKudDECoUqADHu3-tLijV0m" + "uer990OtbKeSrW9ICCVpjrbh5aPezOLNXcDkfxGB" + "S~yLpUgLn1aCFQv6Bz1htwfEpeKfqQvwVfD17SoW" + "-8XBA2ORSqXGOL9x93tzmt1pspsfgehXTqEVerH9" + "H9qCAECvRtyHu7jh-DNxFtnA-w5PTg7sf0uKKMO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3bGQfUtEhJ" + "xh61nVfh3k1F3EuczB~f1ekAZDMa9qhkp-Rv67~S" + "97ASXgyz673QLIoksK2udHB0iHPL6H2pJlBpv4oH" + "4YnA0o4ejTUy5vLgret0ItpMao4waezWK8TMHAzD" + "STd76eOIacKbIYkuorpx2atQrHizDQ9vPSIvurH7" + "8gMHJ03JnYoh60zIvZIqDajTS9vrqIvvu5HaB2re" + "bqmfMx2XKEvjqEBA7hPdqXR6n9typIcj1tqdHK-h" + "9iOYkQ81u64y6SgYMxuXNd38AFTUUouh1OQp2jVv" + "pnLLR-vUT1-G-lO8Xw5wrlwx6G4BA3peKmaMIxBu" + "iJA0qLUc336-oFXvThUh2JwT9RshrKclS7vp-zc9" + "8dzAXxATuxKakXZaJGQ91xWyTkz8lFzuGnfWK5HF" + "CgNiOa2F8nbR5kzofCXyYHyRbp9pT8Ek1xAK0Ayp" + "FYwqfcVFZnhe0TXcup5UDgdFlroirzfJaDIbQKBz" + "O4cS68Kd4YV9HPgu2de84dz~PfIgredg-A-rKon8" + "1ZhGylOgaXCDNNag9mjdF7B5nFjddYytaOgFCTDR" + "G0ntFV8mMDIwxW9GZtt6MSJQSJqjdOM1ywFdPrdX" + "GDKnib~NO247LxGLa05wUZPMvg92~mPgg9SkD9v4" + "-g008LITmMajbpE8~0t-jijMKJkPCQxOaBsH5-fn" + "uToqxg-xm0d9wg48Xr5BmirS5UbC7pS-U9pKI1E8" + "vp~DWbxxRpulZYhgNq2-cR2w7ie01mDleoUv-tdk" + "T9L1erdyTAhHrw2YNe0SD8OmyvW4aPPsjAGMeg=="; var egdata = FreenetBase64.Decode(ed); var di = new I2PDestinationInfo(new BufRefLen(myinfo)); var decr = ElGamalCrypto.Decrypt(new BufLen(egdata, 4, 514), di.PrivateKey, true); }
public I2PDestinationInfo(string base64) : this(new BufRefLen(FreenetBase64.Decode(base64))) { }