Exemple #1
0
        //Testing class encryption in RSA.
        public bool ClassEncryption()
        {
            KeyPair test = RSA.GenerateKeyPair(64);

            var dummy = new DummyClass();

            //Test variable for integrity check.
            dummy.dummy = 1;

            LockedBytes encryptedDummy = RSA.EncryptClass(dummy, test.public_);
            var         newdummy       = RSA.DecryptClass <DummyClass>(encryptedDummy, test.private_);

            if (newdummy.dummy == dummy.dummy)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }