ProcessByte() публичный Метод

public ProcessByte ( byte input ) : byte[]
input byte
Результат byte[]
Пример #1
0
        /// <summary>
        /// Encapsulates the specified links into an RSDF container.
        /// </summary>
        /// <param name="links">The links.</param>
        /// <returns>
        /// Base-16-encoded RSDF container.
        /// </returns>
        public static string CreateRSDF(string[] links)
        {
            var aes = new AesEngine();
            var cfb = new CfbBlockCipher(aes, 8);
            var pad = new BufferedBlockCipher(cfb);
            var sb  = new StringBuilder();

            pad.Init(true, new ParametersWithIV(new KeyParameter(RSDFKey), RSDFIV));

            foreach (var link in links)
            {
                var input  = Encoding.UTF8.GetBytes(link);
                var output = new byte[input.Length];

                for (var i = 0; i < input.Length; i++)
                {
                    output[i] = pad.ProcessByte(input[i])[0];
                }

                sb.Append(Convert.ToBase64String(output));
                sb.Append(Environment.NewLine);
            }

            return BitConverter.ToString(Encoding.ASCII.GetBytes(sb.ToString())).Replace("-", string.Empty);
        }