예제 #1
0
        public Rc4(int key)
        {
            key = key < 0 ? 0 : key;
            var nKey = new[] { (byte)key };

            if (key > byte.MaxValue)
            {
                nKey = key > ushort.MaxValue ? Modern.CypherInt(key) : Modern.CypherShort((ushort)key);
            }
            Initialize(nKey);
        }
예제 #2
0
        private void ModernCypherIntegerBtn_Click(object sender, EventArgs e)
        {
            int value;

            if (int.TryParse(ModernIntegerInputTxt.Text, out value))
            {
                ModernIntegerOutputTxt.Text = HMessage.ToString(Modern.CypherInt(value));
            }
            else
            {
                MessageBox.Show(NotInt32, TanjiError, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }