Ejemplo n.º 1
0
        protected override BitStream internalEncode(BitStream data)
        {
            string dataAsString = Encoding.ASCII.GetString(data.Value);
            string salt         = dataAsString.Substring(0, 2);
            string result       = UnixCryptTool.Crypt(salt, dataAsString);

            return(new BitStream(System.Text.ASCIIEncoding.ASCII.GetBytes(result)));
        }
Ejemplo n.º 2
0
        protected override BitwiseStream internalEncode(BitwiseStream data)
        {
            var    reader       = new BitReader(data);
            string dataAsString = reader.ReadString();
            string salt         = dataAsString.Substring(0, 2);
            string result       = UnixCryptTool.Crypt(salt, dataAsString);

            var ret    = new BitStream();
            var writer = new BitWriter(ret);

            writer.WriteString(result);
            ret.Seek(0, SeekOrigin.Begin);
            return(ret);
        }