コード例 #1
0
        public StretchedHash(ByteSequence h, ByteSequence s, int i)
        {
            hash = h;

            salt       = s;
            iterations = i;
        }
コード例 #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));
        }
コード例 #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)
                );
        }
コード例 #4
0
 public StretchedHash(byte[] b, int hs, int ss, int i) : this(b, hs, ByteSequence.GenerateCryptographic(ss), i)
 {
 }
コード例 #5
0
 static public void Write(this BinaryWriter item, ByteSequence value)
 {
     item.Write(value.GetSize());
     item.Write(value.GetBytes());
 }
コード例 #6
0
 static public string ToHexString(this ByteSequence item)
 {
     return(item.GetBytes().ToHexString());
 }
コード例 #7
0
 static public string ToBinaryRepresentationString(this ByteSequence item, BinaryRepresentationType type)
 {
     return(item.GetBytes().ToBinaryRepresentationString(type));
 }