Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for doFinal (0.05 sec)

  1. src/test/java/jcifs/util/CryptoTest.java

            encryptCipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "RC4"));
            byte[] encrypted = encryptCipher.doFinal(plaintext);
    
            Cipher decryptCipher = Crypto.getArcfour(key);
            decryptCipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(key, "RC4"));
            byte[] decrypted = decryptCipher.doFinal(encrypted);
    
            // Then
            assertNotNull(encrypted);
            assertNotNull(decrypted);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.4K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/hash/MacHashFunctionTest.java

        mac.init(MD5_KEY);
        mac.update(input.getBytes(UTF_8));
        assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal()).toString());
        assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal(input.getBytes(UTF_8))).toString());
        assertEquals(knownOutput, Hashing.hmacMd5(MD5_KEY).hashString(input, UTF_8).toString());
        assertEquals(knownOutput, Hashing.hmacMd5(MD5_KEY).hashBytes(input.getBytes(UTF_8)).toString());
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Fri Dec 27 16:19:35 UTC 2024
    - 13.8K bytes
    - Viewed (0)
  3. src/main/java/org/codelibs/core/crypto/CachedCipher.java

         * @return the encrypted data
         */
        public byte[] encrypto(final byte[] data) {
            final Cipher cipher = pollEncryptoCipher();
            byte[] encrypted;
            try {
                encrypted = cipher.doFinal(data);
            } catch (final IllegalBlockSizeException e) {
                throw new IllegalBlockSizeRuntimeException(e);
            } catch (final BadPaddingException e) {
                throw new BadPaddingRuntimeException(e);
    Registered: Fri Sep 05 20:58:11 UTC 2025
    - Last Modified: Sat Jul 05 00:11:05 UTC 2025
    - 11.5K bytes
    - Viewed (0)
  4. src/main/java/jcifs/pac/PacMac.java

            int ms_usage = mapArcfourMD5KeyUsage(keyusage);
            Mac mac = Mac.getInstance("HmacMD5");
            MessageDigest md = MessageDigest.getInstance("MD5");
            mac.init(key);
            byte[] dk = mac.doFinal(MD5_CONSTANT);
            try {
                // little endian
                md.update((byte) (ms_usage & 0xFF));
                md.update((byte) (ms_usage >> 8 & 0xFF));
                md.update((byte) (ms_usage >> 16 & 0xFF));
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 9K bytes
    - Viewed (0)
  5. src/main/java/jcifs/pac/kerberos/KerberosEncData.java

            cipher.init(Cipher.DECRYPT_MODE, dataKey);
    
            int plainDataLength = data.length - KerberosConstants.CHECKSUM_SIZE;
            byte[] plainData = cipher.doFinal(data, KerberosConstants.CHECKSUM_SIZE, plainDataLength);
    
            byte[] plainDataChecksum = getHmac(plainData, codeHmac);
            if (plainDataChecksum.length >= KerberosConstants.CHECKSUM_SIZE) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 12.5K bytes
    - Viewed (0)
  6. src/main/java/jcifs/internal/smb2/Smb2SigningDigest.java

                    throw new RuntimeException("Failed to create Mac instance", e);
                }
    
                mac.update(data, offset, length);
                final byte[] sig = mac.doFinal();
                System.arraycopy(sig, 0, data, offset + SIGNATURE_OFFSET, SIGNATURE_LENGTH);
            } finally {
                this.signingLock.unlock();
            }
        }
    
        /**
         *
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 9.9K bytes
    - Viewed (0)
  7. src/main/java/jcifs/internal/smb2/Smb2EncryptionContext.java

            // Process message (will be encrypted)
            final byte[] output = new byte[cipher.getOutputSize(message.length)];
            int len = cipher.processBytes(message, 0, message.length, output, 0);
            len += cipher.doFinal(output, len);
    
            // Split ciphertext and authentication tag
            final int tagLength = getAuthTagLength();
            final byte[] ciphertext = new byte[message.length];
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 35.5K bytes
    - Viewed (0)
  8. src/main/java/jcifs/util/SecureCredentialStorage.java

                GCMParameterSpec gcmSpec = new GCMParameterSpec(GCM_TAG_SIZE, iv);
                cipher.init(Cipher.ENCRYPT_MODE, masterKey, gcmSpec);
    
                // Encrypt
                byte[] ciphertext = cipher.doFinal(plaintextBytes);
    
                // Combine IV and ciphertext
                byte[] result = new byte[GCM_IV_SIZE + ciphertext.length];
                System.arraycopy(iv, 0, result, 0, GCM_IV_SIZE);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 12.7K bytes
    - Viewed (0)
  9. src/main/java/jcifs/smb/NtlmContext.java

                log.debug("Truncated " + Hexdump.toHexString(trunc));
            }
    
            if ((this.ntlmsspFlags & NtlmFlags.NTLMSSP_NEGOTIATE_KEY_EXCH) != 0) {
                try {
                    trunc = this.sealClientHandle.doFinal(trunc);
                    if (log.isDebugEnabled()) {
                        log.debug("Encrypted " + Hexdump.toHexString(trunc));
                    }
                } catch (final GeneralSecurityException e) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 17.3K bytes
    - Viewed (0)
  10. src/test/java/jcifs/internal/smb2/Smb2SigningDigestTest.java

                for (int i = 0; i < SIGNATURE_LENGTH; i++) {
                    data[SIGNATURE_OFFSET + i] = 0;
                }
    
                mac.update(data, 0, data.length);
                byte[] signature = mac.doFinal();
    
                // Place signature in data
                System.arraycopy(signature, 0, data, SIGNATURE_OFFSET, SIGNATURE_LENGTH);
    
                boolean result = digest.verify(data, 0, data.length, 0, msg);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 43.7K bytes
    - Viewed (0)
Back to top