Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for SecretKeySpec (0.14 sec)

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

            // When
            Cipher encryptCipher = Crypto.getArcfour(key);
            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
    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. src/main/java/jcifs/pac/PacMac.java

    import java.security.MessageDigest;
    import java.util.Arrays;
    import java.util.Map;
    
    import javax.crypto.Cipher;
    import javax.crypto.Mac;
    import javax.crypto.spec.IvParameterSpec;
    import javax.crypto.spec.SecretKeySpec;
    import javax.security.auth.kerberos.KerberosKey;
    
    /**
     * Utility class for calculating and verifying PAC (Privilege Attribute Certificate) message authentication codes.
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 9K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/hash/Hashing.java

       * SHA-1 (160 hash bits) hash function and a {@link SecretKeySpec} created from the given byte
       * array and the SHA-1 algorithm.
       *
       * @param key the key material of the secret key
       * @since 20.0
       */
      public static HashFunction hmacSha1(byte[] key) {
        return hmacSha1(new SecretKeySpec(checkNotNull(key), "HmacSHA1"));
      }
    
      /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Jul 17 15:26:41 UTC 2025
    - 29.8K bytes
    - Viewed (0)
  4. src/main/java/org/codelibs/core/crypto/CachedCipher.java

         *
         * @return an encryption cipher
         */
        protected Cipher pollEncryptoCipher() {
            Cipher cipher = encryptoQueue.poll();
            if (cipher == null) {
                final SecretKeySpec sksSpec = new SecretKeySpec(key.getBytes(), algorithm);
                try {
                    cipher = Cipher.getInstance(algorithm);
                    cipher.init(Cipher.ENCRYPT_MODE, sksSpec);
    Registered: Fri Sep 05 20:58:11 UTC 2025
    - Last Modified: Sat Jul 05 00:11:05 UTC 2025
    - 11.5K bytes
    - Viewed (0)
  5. src/main/java/jcifs/util/Crypto.java

    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;
    import java.security.Provider;
    
    import javax.crypto.Cipher;
    import javax.crypto.NoSuchPaddingException;
    import javax.crypto.spec.SecretKeySpec;
    
    import org.bouncycastle.jce.provider.BouncyCastleProvider;
    
    import jcifs.CIFSUnsupportedCryptoException;
    
    /**
     * Cryptographic utility class providing encryption and decryption functionality for jCIFS.
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 5.7K bytes
    - Viewed (0)
  6. src/main/java/jcifs/pac/kerberos/KerberosEncData.java

            System.arraycopy(data, 0, dataChecksum, 0, KerberosConstants.CHECKSUM_SIZE);
    
            byte[] dataHmac = getHmac(dataChecksum, codeHmac);
            SecretKeySpec dataKey = new SecretKeySpec(dataHmac, KerberosConstants.RC4_ALGORITHM);
    
            cipher = Cipher.getInstance(KerberosConstants.RC4_ALGORITHM);
            cipher.init(Cipher.DECRYPT_MODE, dataKey);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 12.5K bytes
    - Viewed (0)
  7. guava/src/com/google/common/hash/Hashing.java

       * SHA-1 (160 hash bits) hash function and a {@link SecretKeySpec} created from the given byte
       * array and the SHA-1 algorithm.
       *
       * @param key the key material of the secret key
       * @since 20.0
       */
      public static HashFunction hmacSha1(byte[] key) {
        return hmacSha1(new SecretKeySpec(checkNotNull(key), "HmacSHA1"));
      }
    
      /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 22:06:57 UTC 2025
    - 31.1K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/hash/MacHashFunctionTest.java

      private static final SecretKey MD5_KEY =
          new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");
      private static final SecretKey SHA1_KEY =
          new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
      private static final SecretKey SHA256_KEY =
          new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
      private static final SecretKey SHA512_KEY =
          new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA512");
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Fri Dec 27 16:19:35 UTC 2024
    - 13.8K bytes
    - Viewed (0)
  9. src/test/java/jcifs/pac/PacMacTest.java

         * @throws GeneralSecurityException
         */
        @Test
        void testCalculateMacArcfourHMACMD5() throws GeneralSecurityException {
            // Using a key with a known value for reproducibility
            SecretKeySpec key = new SecretKeySpec(new byte[16], "ARCFOUR");
            byte[] mac = PacMac.calculateMacArcfourHMACMD5(3, key, TEST_DATA);
            assertNotNull(mac);
            assertEquals(16, mac.length);
    
            // Test with a different key usage
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  10. src/main/java/jcifs/internal/smb2/Smb2EncryptionContext.java

                }
    
                // Create cipher with the copy - algorithm is just "AES" for SecretKeySpec
                final SecretKeySpec keySpec = new SecretKeySpec(keyCopy, "AES");
                final Cipher cipher = Cipher.getInstance(transformation);
                final GCMParameterSpec gcmSpec = new GCMParameterSpec(getAuthTagLength() * 8, nonce);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 35.5K bytes
    - Viewed (0)
Back to top