Esempio n. 1
0
        public string BuildEncrypted(uint key)
        {
            var arguments = Build();

            var blowfish   = new Blowfish(GetKeyBytes(key));
            var ciphertext = blowfish.Encrypt(Encoding.UTF8.GetBytes(arguments));
            var base64Str  = ToSeBase64String(ciphertext);
            var checksum   = DeriveChecksum(key);

            return($"//**sqex{version:D04}{base64Str}{checksum}**//");
        }
Esempio n. 2
0
        public string BuildEncrypted(uint key)
        {
            var arguments = m_arguments.Aggregate(new StringBuilder(),
                                                  // Yes, they do have a space prepended even for the first argument.
                                                  (whole, part) => whole.Append($" /{EscapeValue(part.Key)} ={EscapeValue(part.Value)}"))
                            .ToString();

            var blowfish   = new Blowfish(GetKeyBytes(key));
            var ciphertext = blowfish.Encrypt(Encoding.UTF8.GetBytes(arguments));
            var base64Str  = ToSeBase64String(ciphertext);
            var checksum   = DeriveChecksum(key);

            Log.Information("ArgumentBuilder::BuildEncrypted() checksum:{0}", checksum);

            return($"//**sqex{version:D04}{base64Str}{checksum}**//");
        }