Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for getDES (0.05 sec)

  1. src/main/java/jcifs/util/Crypto.java

         *
         * @param key
         *            7 or 8 byte DES key
         * @return DES cipher in encryption mode
         */
        public static Cipher getDES(final byte[] key) {
            if (key.length == 7) {
                return getDES(des7to8(key));
            }
    
            try {
                final Cipher c = Cipher.getInstance("DES/ECB/NoPadding");
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 5.7K bytes
    - Viewed (0)
  2. src/test/java/jcifs/util/CryptoTest.java

            // Given
            byte[] key = "testkey1".getBytes(); // 8 bytes for DES
            byte[] plaintext = "12345678".getBytes(); // 8 bytes (DES block size)
    
            // When
            Cipher desCipher = Crypto.getDES(key);
            desCipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "DES"));
            byte[] encrypted = desCipher.doFinal(plaintext);
    
            // Then
            assertNotNull(encrypted);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.4K bytes
    - Viewed (0)
Back to top