예제 #1
0
        public static string[] Encrypter(string textToEncrypt, PathProvider p)
        {
            WebBase64 sessionMaterial;
            WebBase64 cipherText;
            string[] data;
            string path = p.GetPublicPath();

            using (var encrypter = new Encrypter(path))
            using (var sessionCrypter = new SessionCrypter(encrypter))
            {
                sessionMaterial = sessionCrypter.SessionMaterial;
                cipherText = sessionCrypter.Encrypt(textToEncrypt);
                data = new string[] { sessionMaterial.ToString(), cipherText.ToString() };
                //data.Add("sessionmaterial", sessionMaterial);
                //data.Add("data", cipherText);

            }
            return data;
        }