Ejemplo n.º 1
0
        public bool DecryptHeader(string password, bool checkonly = false)
        {
            ReadHeader();

            if (_header == null)
            {
                throw new InvalidOperationException("Header not decrypted");
            }
            DEBUG.Print(GetType(), "unlock");
            string d = Crypto.Decrypt(this._header, EnhancePassword(password));

            if (d == null)
            {
                return(false);
            }
            if (_headerRegex.IsMatch(d))
            {
                if (!checkonly)
                {
                    this._decryptedheader = d;
                }
                return(true);
            }
            return(false);
        }