/// <summary>
        /// Get settings as byte array
        /// </summary>
        /// <returns>Byte array</returns>
        public byte[] GetSettingsAsBytes()
        {
            byte[] returnValue = null;

            Enum.TryParse(this.algorithm, out SymmetricEncryptionAlgorithm actualAlgorithm);

            if (actualAlgorithm == SymmetricEncryptionAlgorithm.AES_CTR)
            {
                returnValue = ChecksumHelper.JoinByteArrays(
                    Encoding.UTF8.GetBytes(this.algorithm),
                    BitConverter.GetBytes(this.keySizeInBits),
                    settingsAES_CTR.GetSettingsAsBytes()
                    );
            }
            else if (actualAlgorithm == SymmetricEncryptionAlgorithm.ChaCha20)
            {
                returnValue = ChecksumHelper.JoinByteArrays(
                    Encoding.UTF8.GetBytes(this.algorithm),
                    BitConverter.GetBytes(this.keySizeInBits),
                    settingsChaCha20.GetSettingsAsBytes()
                    );
            }
            else
            {
                throw new NotImplementedException();
            }

            return(returnValue);
        }
Exemplo n.º 2
0
 private string CalculateHexChecksum()
 {
     return(ChecksumHelper.CalculateHexChecksum(this.firstName, this.lastName, this.middleName, this.namePrefix, this.nameSuffix, this.nickname,
                                                this.company, this.jobTitle, this.department, this.emails, this.emailDescriptions, this.phoneNumbers, this.phoneNumberDescriptions,
                                                this.country, this.streetAddress, this.streetAddressAdditional, this.postalCode, this.city, this.poBox,
                                                this.birthday, this.websites, this.relationship, this.notes,
                                                BitConverter.GetBytes(this.creationTime), BitConverter.GetBytes(this.modificationTime)));
 }
 private string CalculateHexChecksum()
 {
     return(ChecksumHelper.CalculateHexChecksum(Encoding.UTF8.GetBytes(this.algorithm), Encoding.UTF8.GetBytes(this.pseudorandomFunction), this.salt,
                                                BitConverter.GetBytes(this.iterations), BitConverter.GetBytes(this.derivedKeyLengthInBytes), this.keyIdentifier));
 }
 /// <summary>
 /// Get settings as byte array
 /// </summary>
 /// <returns>Byte array</returns>
 public byte[] GetSettingsAsBytes()
 {
     // Join them together
     return(ChecksumHelper.JoinByteArrays(this.nonce, BitConverter.GetBytes(counter)));
 }
Exemplo n.º 5
0
 private string CalculateHexChecksum()
 {
     return(ChecksumHelper.CalculateHexChecksum(this.keyIdentifier, this.audalfData, algorithm.GetSettingsAsBytes()));
 }
Exemplo n.º 6
0
 private string CalculateHexChecksum()
 {
     return(ChecksumHelper.CalculateHexChecksum(this.title, this.nameOnCard, this.cardType, this.number, this.securityCode, this.startDate, this.expirationDate, this.notes, BitConverter.GetBytes(this.creationTime),
                                                BitConverter.GetBytes(this.modificationTime)));
 }
Exemplo n.º 7
0
		private string CalculateHexChecksum()
		{
			return ChecksumHelper.CalculateHexChecksum(this.noteTitle, this.noteText, BitConverter.GetBytes(this.creationTime),
														BitConverter.GetBytes(this.modificationTime));
		}
 private string CalculateHexChecksum()
 {
     return(ChecksumHelper.CalculateHexChecksum(this.title, this.url, this.email, this.username, this.password, this.notes, this.mfa, BitConverter.GetBytes(this.creationTime), BitConverter.GetBytes(this.modificationTime),
                                                this.icon, this.category, this.tags));
 }
Exemplo n.º 9
0
 private string CalculateHexChecksum()
 {
     return(ChecksumHelper.CalculateHexChecksum(this.filename, this.fileContent, BitConverter.GetBytes(this.creationTime), BitConverter.GetBytes(this.modificationTime)));
 }