Ejemplo n.º 1
0
        public override void Decrypt(string inputPath, string outputPath)
        {
            var file = ReadFile(inputPath);

            RsaKey     decryptKey = RsaKeyManager.GetRsaKey(rsaKeyPath);
            BigInteger _d         = decryptKey.FirstPart;
            BigInteger _n         = decryptKey.SecondPart;
            int        sizePart   = GetPartKeyLength(_n);

            IncreaseByteArray(ref file, sizePart);
            RunDecrypt(outputPath, file.Length, sizePart, ref file, _d, _n);
        }
Ejemplo n.º 2
0
        public override void Encrypt(string inputPath, string outputPath)
        {
            byte[] file = ReadFile(inputPath);

            RsaKey     encryptKey = RsaKeyManager.GetRsaKey(rsaKeyPath);
            BigInteger _e         = encryptKey.FirstPart;
            BigInteger _n         = encryptKey.SecondPart;
            int        sizePart   = GetPartKeyLength(_n);

            IncreaseByteArray(ref file, sizePart - 1);
            RunEncrypt(outputPath, file.Length, sizePart, ref file, _e, _n);
        }