List Algorithm Java Security


Setelah di postingan sebelum nya kita telah mencoba membuat beberapa algortima seperti DES, RC5 dan GOST, sekarang kita akan mencoba menelaah lebih lanjut tentang java class security. algoritma apa saya yang sudah disediakan oleh class tersebut kita dapat melihat dalam script sebagai berikut:

package support_class;   
import java.security.Provider;
import java.security.Security;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class ListAlgorithm {
  public static void printSet(String setName, Set algorithms) {
    System.out.println(setName + ":");
    if (algorithms.isEmpty()) {
      System.out.println("            None available.");
    } else {
      Iterator it = algorithms.iterator();
      while (it.hasNext()) {
        String name = (String) it.next();

        System.out.println("            " + name);
      }
    }
  }

  public static void main(String[] args) {
    Provider[] providers = Security.getProviders();
    Set<String> ciphers = new HashSet<String>();
    Set<String> keyAgreements = new HashSet<String>();
    Set<String> macs = new HashSet<String>();
    Set<String> messageDigests = new HashSet<String>();
    Set<String> signatures = new HashSet<String>();

    for (int i = 0; i != providers.length; i++) {
      Iterator it = providers[i].keySet().iterator();

      while (it.hasNext()) {
        String entry = (String) it.next();

        if (entry.startsWith("Alg.Alias.")) {
          entry = entry.substring("Alg.Alias.".length());
        }

        if (entry.startsWith("Cipher.")) {
          ciphers.add(entry.substring("Cipher.".length()));
        } else if (entry.startsWith("KeyAgreement.")) {
          keyAgreements.add(entry.substring("KeyAgreement.".length()));
        } else if (entry.startsWith("Mac.")) {
          macs.add(entry.substring("Mac.".length()));
        } else if (entry.startsWith("MessageDigest.")) {
          messageDigests.add(entry.substring("MessageDigest.".length()));
        } else if (entry.startsWith("Signature.")) {
          signatures.add(entry.substring("Signature.".length()));
        }
      }
    }

    printSet("Ciphers", ciphers);
    printSet("KeyAgreeents", keyAgreements);
    printSet("Macs", macs);
    printSet("MessageDigests", messageDigests);
    printSet("Signatures", signatures);
  }
}

hasil yang didapatkan sebagai berikut:
Ciphers:
PBEWithMD5AndDES
AESWrap SupportedPaddings
PBEWithHmacSHA512AndAES_128
AES_192/CFB/NoPadding
OID.2.16.840.1.101.3.4.1.5
OID.2.16.840.1.101.3.4.1.4
PBEWithSHA1AndRC4_128
OID.2.16.840.1.101.3.4.1.3
PBEWithMD5AndTripleDES
OID.2.16.840.1.101.3.4.1.2
OID.2.16.840.1.101.3.4.1.1
AES SupportedPaddings
OID.2.16.840.1.101.3.4.1.6
RC2
RSA
RC4
PBEWithHmacSHA512AndAES_256
RC2 SupportedPaddings
DES SupportedModes
AES_192/OFB/NoPadding
RC2 SupportedKeyFormats
OID.2.16.840.1.101.3.4.1.46
2.16.840.1.101.3.4.1.21
OID.2.16.840.1.101.3.4.1.41
2.16.840.1.101.3.4.1.23
2.16.840.1.101.3.4.1.22
DES SupportedPaddings
2.16.840.1.101.3.4.1.25
OID.2.16.840.1.101.3.4.1.44
PBEWithSHA1AndRC2_128
2.16.840.1.101.3.4.1.24
OID.2.16.840.1.101.3.4.1.45
OID.2.16.840.1.101.3.4.1.42
2.16.840.1.101.3.4.1.26
OID.2.16.840.1.101.3.4.1.43
AES_128/CFB/NoPadding
DESedeWrap SupportedModes
PBEWithHmacSHA1AndAES_256
ARCFOUR SupportedModes
AES_256/CBC/NoPadding
DESede SupportedKeyFormats
DESede SupportedModes
AESWrap_256
RSA SupportedModes
AES_192/GCM/NoPadding
AES_128/CBC/NoPadding
AESWrap SupportedModes
AES_128/OFB/NoPadding
AESWrap_128
OID.2.16.840.1.101.3.4.1.26
OID.2.16.840.1.101.3.4.1.24
ARCFOUR
OID.2.16.840.1.101.3.4.1.25
ARCFOUR SupportedPaddings
DES SupportedKeyFormats
OID.2.16.840.1.101.3.4.1.22
OID.2.16.840.1.101.3.4.1.23
AESWrap
OID.2.16.840.1.101.3.4.1.21
1.2.840.113549.1.5.3
AES_192/ECB/NoPadding
Blowfish
PBEWithHmacSHA224AndAES_128
Blowfish SupportedKeyFormats
PBEWithHmacSHA384AndAES_128
DESede
PBEWithSHA1AndDESede
PBEWithSHA1AndRC4_40
1.2.840.113549.1.12.1.3
AESWrap_192
1.2.840.113549.1.12.1.2
Rijndael
1.2.840.113549.1.12.1.1
PBEWithHmacSHA224AndAES_256
1.2.840.113549.1.12.1.6
1.2.840.113549.1.12.1.5
OID.1.2.840.113549.1.5.3
DESede SupportedPaddings
AES_256/ECB/NoPadding
AES_128/GCM/NoPadding
2.16.840.1.101.3.4.1.6
2.16.840.1.101.3.4.1.3
2.16.840.1.101.3.4.1.2
2.16.840.1.101.3.4.1.5
AES
AES_256/OFB/NoPadding
2.16.840.1.101.3.4.1.4
AES SupportedModes
Blowfish SupportedModes
AES SupportedKeyFormats
PBEWithSHA1AndRC2_40
RC2 SupportedModes
2.16.840.1.101.3.4.1.1
PBEWithHmacSHA256AndAES_256
ARCFOUR SupportedKeyFormats
TripleDES
RSA SupportedPaddings
DESedeWrap SupportedPaddings
PBEWithHmacSHA1AndAES_128
AES_192/CBC/NoPadding
RSA SupportedKeyClasses
AESWrap SupportedKeyFormats
AES_128/ECB/NoPadding
2.16.840.1.101.3.4.1.41
AES_256/GCM/NoPadding
OID.1.2.840.113549.1.12.1.1
2.16.840.1.101.3.4.1.43
OID.1.2.840.113549.1.12.1.2
2.16.840.1.101.3.4.1.42
PBEWithHmacSHA256AndAES_128
OID.1.2.840.113549.1.12.1.3
2.16.840.1.101.3.4.1.45
DES
2.16.840.1.101.3.4.1.44
2.16.840.1.101.3.4.1.46
DESedeWrap
DESedeWrap SupportedKeyFormats
PBEWithHmacSHA384AndAES_256
Blowfish SupportedPaddings
OID.1.2.840.113549.1.12.1.5
OID.1.2.840.113549.1.12.1.6
AES_256/CFB/NoPadding
KeyAgreeents:
ECDH SupportedKeyClasses
ECDH
ECDH ImplementedIn
DH
1.2.840.113549.1.3.1
OID.1.2.840.113549.1.3.1
DiffieHellman SupportedKeyClasses
DiffieHellman
Macs:
SslMacMD5 SupportedKeyFormats
SslMacSHA1
PBEWithHmacSHA384 SupportedKeyFormats
OID.1.2.840.113549.2.10
PBEWithHmacSHA256 SupportedKeyFormats
HmacSHA512
1.2.840.113549.2.11
HmacPBESHA1
HmacSHA512 SupportedKeyFormats
OID.1.2.840.113549.2.11
HmacSHA224 SupportedKeyFormats
HmacMD5
HmacSHA256
1.2.840.113549.2.10
PBEWithHmacSHA384
HmacSHA1
SslMacSHA1 SupportedKeyFormats
PBEWithHmacSHA224
1.2.840.113549.2.8
HmacSHA256 SupportedKeyFormats
1.2.840.113549.2.9
PBEWithHmacSHA224 SupportedKeyFormats
PBEWithHmacSHA512 SupportedKeyFormats
OID.1.2.840.113549.2.9
PBEWithHmacSHA1
OID.1.2.840.113549.2.8
OID.1.2.840.113549.2.7
1.2.840.113549.2.7
HmacPBESHA1 SupportedKeyFormats
PBEWithHmacSHA256
HmacSHA1 SupportedKeyFormats
HmacSHA224
HmacSHA384
HmacMD5 SupportedKeyFormats
SslMacMD5
PBEWithHmacSHA1 SupportedKeyFormatS
HmacSHA384 SupportedKeyFormats
PBEWithHmacSHA512
MessageDigests:
SHA-1
SHA1
SHA-384
MD5 ImplementedIn
OID.1.3.14.3.2.26
2.16.840.1.101.3.4.2.2
SHA
2.16.840.1.101.3.4.2.1
2.16.840.1.101.3.4.2.4
2.16.840.1.101.3.4.2.3
OID.2.16.840.1.101.3.4.2.4
OID.2.16.840.1.101.3.4.2.3
OID.2.16.840.1.101.3.4.2.2
1.3.14.3.2.26
OID.2.16.840.1.101.3.4.2.1
SHA-224
SHA-256
MD2
SHA ImplementedIn
SHA-512
MD5
Signatures:
SHAwithDSA
NONEwithECDSA SupportedKeyClasses
SHA1withDSA KeySize
SHA224withRSA
OID.1.2.840.10045.4.1
SHA256withDSA SupportedKeyClasses
OID.2.16.840.1.101.3.4.3.2
OID.2.16.840.1.101.3.4.3.1
SHA1withDSA ImplementedIn
SHA1withDSA SupportedKeyClasses
OID.1.2.840.10045.4.3.4
DSA
OID.1.2.840.10045.4.3.2
OID.1.2.840.10045.4.3.3
SHA384withECDSA ImplementedIn
OID.1.2.840.10045.4.3.1
MD5andSHA1withRSA
OID.1.2.840.113549.1.1.4
SHA1withECDSA ImplementedIn
OID.1.2.840.113549.1.1.5
OID.1.2.840.113549.1.1.2
SHA1withECDSA SupportedKeyClasses
SHA224withDSA
SHA256withRSA SupportedKeyClasses
SHA/DSA
SHA224withECDSA ImplementedIn
DSS
NONEwithDSA KeySize
SHA256withECDSA SupportedKeyClasses
1.2.840.10045.4.3.4
SHA512withECDSA ImplementedIn
NONEwithECDSA ImplementedIn
DSAWithSHA1
SHA384withECDSA
2.16.840.1.101.3.4.3.1
1.2.840.113549.1.1.13
SHA256withDSA
2.16.840.1.101.3.4.3.2
1.2.840.113549.1.1.14
1.2.840.113549.1.1.11
1.2.840.10040.4.3
1.3.14.3.2.13
1.2.840.113549.1.1.12
SHA224withECDSA
1.2.840.10045.4.3.1
1.2.840.10045.4.3.2
NONEwithDSA SupportedKeyClasses
1.2.840.10045.4.3.3
SHA256withRSA
SHA224withDSA KeySize
MD2withRSA
SHA224withECDSA SupportedKeyClasses
SHA-1/DSA
SHA512withRSA
OID.1.2.840.113549.1.1.13
OID.1.2.840.113549.1.1.14
OID.1.2.840.113549.1.1.11
OID.1.2.840.10040.4.3
OID.1.2.840.113549.1.1.12
SHA512withRSA SupportedKeyClasses
SHA384withRSA
SHA384withRSA SupportedKeyClasses
SHA1withDSA
1.3.14.3.2.29
SHA384withECDSA SupportedKeyClasses
OID.1.3.14.3.2.29
SHA512withECDSA SupportedKeyClasses
1.3.14.3.2.27
SHA1withRSA
SHA256withDSA KeySize
SHA1withECDSA
SHA224withDSA SupportedKeyClasses
SHA1/DSA
SHA224withRSA SupportedKeyClasses
MD5withRSA SupportedKeyClasses
SHA1withRSA SupportedKeyClasses
NONEwithECDSA
RawDSA
1.2.840.10045.4.1
SHA256withECDSA ImplementedIn
MD5withRSA
SHA256withECDSA
SHA512withECDSA
1.2.840.113549.1.1.2
SHA1withECDSA KeySize
1.2.840.113549.1.1.5
1.2.840.113549.1.1.4
MD2withRSA SupportedKeyClasses
NONEwithDSA

 

sumber: http://www.java2s.com/Code/Java/Security/Listtheavailablealgorithmnamesforcipherskeyagreementmacsmessagedigestsandsignatures.htm

Advertisements

Author: ridhobustami

orang ngak jelas

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s