Exemplo n.º 1
0
    public static byte[] encode(byte[] inputByteArray)
    {
        byte[]       rgbKey = Encoding.UTF8.GetBytes(ekey);
        byte[]       rgbIV  = Encoding.UTF8.GetBytes(eiv);
        PKCS5Padding pp     = new PKCS5Padding();

        byte[]    pss = pp.Pad(8, inputByteArray);
        DesCipher cc  = new DesCipher(rgbKey, new CbcCipherMode(rgbIV), null);

        return(cc.Encrypt(pss));
    }
Exemplo n.º 2
0
        public void PadTest()
        {
            PKCS5Padding target    = new PKCS5Padding(); // TODO: Initialize to an appropriate value
            int          blockSize = 0;                  // TODO: Initialize to an appropriate value

            byte[] input    = null;                      // TODO: Initialize to an appropriate value
            byte[] expected = null;                      // TODO: Initialize to an appropriate value
            byte[] actual;
            actual = target.Pad(blockSize, input);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Exemplo n.º 3
0
        public void PKCS5PaddingConstructorTest()
        {
            PKCS5Padding target = new PKCS5Padding();

            Assert.Inconclusive("TODO: Implement code to verify target");
        }
Exemplo n.º 4
0
 public void SetUp()
 {
     _padding = new PKCS5Padding();
 }