Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 34 for cipherA (0.23 sec)

  1. src/main/java/jcifs/internal/smb2/nego/EncryptionNegotiateContext.java

        private int[] ciphers;
    
        /**
         * Constructs an encryption negotiate context.
         *
         * @param config the configuration (currently unused)
         * @param ciphers array of encryption cipher IDs to negotiate
         */
        public EncryptionNegotiateContext(final Configuration config, final int ciphers[]) {
            this.ciphers = ciphers;
        }
    
        /**
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 3.8K bytes
    - Viewed (0)
  2. src/main/java/jcifs/internal/smb2/Smb2EncryptionContext.java

                final Cipher cipher = Cipher.getInstance(transformation);
                final GCMParameterSpec gcmSpec = new GCMParameterSpec(getAuthTagLength() * 8, nonce);
    
                cipher.init(encrypt ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE, keySpec, gcmSpec);
                return cipher;
            } finally {
                // Guaranteed cleanup of all key material
                if (key != null) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 35.5K bytes
    - Viewed (0)
  3. src/test/java/jcifs/internal/smb2/nego/EncryptionNegotiateContextTest.java

            void testConstructorWithConfigAndCiphers() {
                int[] ciphers = { EncryptionNegotiateContext.CIPHER_AES128_CCM, EncryptionNegotiateContext.CIPHER_AES128_GCM };
    
                EncryptionNegotiateContext context = new EncryptionNegotiateContext(mockConfig, ciphers);
    
                assertNotNull(context);
                assertArrayEquals(ciphers, context.getCiphers());
            }
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 20.5K bytes
    - Viewed (0)
  4. src/test/java/jcifs/internal/smb2/nego/NegotiateContextRequestTest.java

            void testConstructorWithParameters() {
                int[] ciphers = { EncryptionNegotiateContext.CIPHER_AES128_CCM, EncryptionNegotiateContext.CIPHER_AES128_GCM };
    
                context = new EncryptionNegotiateContext(mockConfig, ciphers);
    
                assertEquals(EncryptionNegotiateContext.NEGO_CTX_ENC_TYPE, context.getContextType());
                assertArrayEquals(ciphers, context.getCiphers());
            }
    
            @Test
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 18.8K bytes
    - Viewed (0)
  5. src/test/java/jcifs/internal/smb2/nego/NegotiateContextResponseTest.java

                // Assert
                // Note: size() returns 4 + (2*ciphers.length) but encode only writes 2 + (2*ciphers.length)
                // This appears to be a bug in the implementation, but we test the actual behavior
                assertEquals(6, encodedSize); // actual encoded size: 2 bytes count + 2*2 bytes for ciphers
                assertEquals(2, buffer[0]); // cipher count (little endian)
                assertEquals(0, buffer[1]);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 19.4K bytes
    - Viewed (0)
  6. src/main/java/jcifs/internal/smb2/nego/Smb2NegotiateRequest.java

                if (config.isEncryptionEnabled()) {
                    // Build cipher list based on AES-256 support
                    List<Integer> ciphers = new ArrayList<>();
    
                    // Prefer GCM over CCM for better performance
                    if (config.isAES256Enabled()) {
                        ciphers.add(EncryptionNegotiateContext.CIPHER_AES256_GCM);
                        ciphers.add(EncryptionNegotiateContext.CIPHER_AES256_CCM);
                    }
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 9.3K bytes
    - Viewed (0)
  7. src/test/java/jcifs/internal/smb2/Smb2EncryptionContextTest.java

        }
    
        @Test
        @DisplayName("Should handle different cipher IDs")
        void testDifferentCipherIds() {
            // Test cipher ID 1 (AES-CCM)
            Smb2EncryptionContext context1 = new Smb2EncryptionContext(1, DialectVersion.SMB311, testEncryptionKey, testDecryptionKey);
            assertEquals(1, context1.getCipherId(), "Should handle cipher ID 1");
    
            // Test cipher ID 2 (AES-GCM)
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 44.1K bytes
    - Viewed (0)
  8. src/test/java/jcifs/internal/smb2/nego/Smb2NegotiateResponseTest.java

        @Test
        @DisplayName("Should return selected cipher")
        void testGetSelectedCipher() throws Exception {
            // Given
            setPrivateField(response, "selectedCipher", EncryptionNegotiateContext.CIPHER_AES128_GCM);
    
            // When
            int cipher = response.getSelectedCipher();
    
            // Then
            assertEquals(EncryptionNegotiateContext.CIPHER_AES128_GCM, cipher);
        }
    
        @Test
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 32.5K bytes
    - Viewed (0)
  9. src/main/java/jcifs/pac/PacMac.java

            byte[] keybytes = key.getEncoded();
            Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
            cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(keybytes, "AES"), new IvParameterSpec(ZERO_IV, 0, ZERO_IV.length));
            if (constant.length != cipher.getBlockSize()) {
                constant = expandNFold(constant, cipher.getBlockSize());
            }
            byte[] enc = constant;
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 9K bytes
    - Viewed (0)
  10. src/main/java/jcifs/util/Crypto.java

            return new HMACT64(key);
        }
    
        /**
         * Get an RC4 cipher instance initialized with the specified key.
         * @param key the encryption key
         * @return RC4 cipher in encryption mode
         */
        public static Cipher getArcfour(final byte[] key) {
            try {
                final Cipher c = Cipher.getInstance("RC4");
                c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "RC4"));
                return c;
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 5.7K bytes
    - Viewed (0)
Back to top