Beispiel #1
0
        public StretchedHash(ByteSequence h, ByteSequence s, int i)
        {
            hash = h;

            salt       = s;
            iterations = i;
        }
Beispiel #2
0
        static public StretchedHash ReadStretchedHash(this BinaryReader item)
        {
            ByteSequence hash       = item.ReadByteSequence();
            ByteSequence salt       = item.ReadByteSequence();
            int          iterations = item.ReadInt32();

            return(new StretchedHash(hash, salt, iterations));
        }
Beispiel #3
0
        public StretchedHash(byte[] b, int hs, ByteSequence s, int i)
        {
            salt       = s;
            iterations = i;

            hash = new ByteSequence(
                new Rfc2898DeriveBytes(b, salt.GetBytes(), iterations).GetBytes(hs)
                );
        }
Beispiel #4
0
 public StretchedHash(byte[] b, int hs, int ss, int i) : this(b, hs, ByteSequence.GenerateCryptographic(ss), i)
 {
 }
Beispiel #5
0
 static public void Write(this BinaryWriter item, ByteSequence value)
 {
     item.Write(value.GetSize());
     item.Write(value.GetBytes());
 }
Beispiel #6
0
 static public string ToHexString(this ByteSequence item)
 {
     return(item.GetBytes().ToHexString());
 }
Beispiel #7
0
 static public string ToBinaryRepresentationString(this ByteSequence item, BinaryRepresentationType type)
 {
     return(item.GetBytes().ToBinaryRepresentationString(type));
 }