Ejemplo n.º 1
0
        private void restoreDomainDataFromSettings(string pwd, string value)
        {
            byte[] domains = Convert.FromBase64String(value);

            Crypter crypt = new Crypter();

            byte[] KGK = null;
            byte[] baSyncData = crypt.decode(pwd, domains, true, ref KGK);

            string d = Encoding.UTF8.GetString(baSyncData);
            var serializer = new JavaScriptSerializer();
            domainlist = serializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(Encoding.UTF8.GetString(baSyncData));
        }
Ejemplo n.º 2
0
        private void restoreSettings(string pwd, string value, ref byte[] KGK)
        {
            byte[] chipper = Convert.FromBase64String(value);

            Crypter crypt = new Crypter();
            byte[] baSyncData = crypt.decode(pwd, chipper, true, ref KGK);

            string d = Encoding.UTF8.GetString(baSyncData);
            var serializer = new JavaScriptSerializer();
            settings = serializer.Deserialize<Dictionary<string, string>>(Encoding.UTF8.GetString(baSyncData));
        }
Ejemplo n.º 3
0
        private string getBase64StringSettings()
        {
            var serializer = new JavaScriptSerializer();
            string json = serializer.Serialize(settings);

            Crypter crypt = new Crypter();
            byte[] baSyncData = crypt.encode(masterkey, iv, salt, kgk, Encoding.ASCII.GetBytes(json), true);
            return Convert.ToBase64String(baSyncData);
        }