Exemplo n.º 1
0
        static void DecryptFile(string inkey, string inflag, string inres, string outfile)
        {
            var key     = new MV2.Key(File.ReadAllBytes(inkey));
            var decoder = new MV2.Decoder(key);

            var flag = File.ReadAllBytes(inflag);
            var res  = File.ReadAllBytes(inres);

            File.WriteAllBytes(outfile, decoder.Decode(flag, res));
        }
Exemplo n.º 2
0
        static void EncryptFile(string inkey, string infile, string outflag, string outres)
        {
            var key     = new MV2.Key(File.ReadAllBytes(inkey));
            var encoder = new MV2.Encoder(key, rounds: 16);

            var result = encoder.Encode(File.ReadAllBytes(infile));

            File.WriteAllBytes(outflag, result.Flag);
            File.WriteAllBytes(outres, result.Residual);
        }