SSL - Simple of DES

本文介绍了一个简单的SSL DES加密/解密C程序。该程序使用OpenSSL库实现对称加密算法DES,并演示了如何通过指定密钥进行数据加密和解密的过程。

 

DES属于对称加密算法
特点: 加密和解密使用相同的密钥


This is a simple c program of SSL DES encrypt/decrypt.

 

 

/** * Sets the SSL properties for the connection. * <p> * Note that these properties are only valid if an implementation of the Java * Secure Socket Extensions (JSSE) is available. These properties are * not used if a SocketFactory has been set using * {@link #setSocketFactory(SocketFactory)}. The following properties can be * used: * </p> * <dl> * <dt>com.ibm.ssl.protocol</dt> * <dd>One of: SSL, SSLv3, TLS, TLSv1, SSL_TLS.</dd> * <dt>com.ibm.ssl.contextProvider * <dd>Underlying JSSE provider. For example "IBMJSSE2" or "SunJSSE"</dd> * * <dt>com.ibm.ssl.keyStore</dt> * <dd>The name of the file that contains the KeyStore object that you want the * KeyManager to use. For example /mydir/etc/key.p12</dd> * * <dt>com.ibm.ssl.keyStorePassword</dt> * <dd>The password for the KeyStore object that you want the KeyManager to use. * The password can either be in plain-text, or may be obfuscated using the * static method: * <code>com.ibm.micro.security.Password.obfuscate(char[] password)</code>. This * obfuscates the password using a simple and insecure XOR and Base64 encoding * mechanism. Note that this is only a simple scrambler to obfuscate clear-text * passwords.</dd> * * <dt>com.ibm.ssl.keyStoreType</dt> * <dd>Type of key store, for example "PKCS12", "JKS", or "JCEKS".</dd> * * <dt>com.ibm.ssl.keyStoreProvider</dt> * <dd>Key store provider, for example "IBMJCE" or "IBMJCEFIPS".</dd> * * <dt>com.ibm.ssl.trustStore</dt> * <dd>The name of the file that contains the KeyStore object that you want the * TrustManager to use.</dd> * * <dt>com.ibm.ssl.trustStorePassword</dt> * <dd>The password for the TrustStore object that you want the TrustManager to * use. The password can either be in plain-text, or may be obfuscated using the * static method: * <code>com.ibm.micro.security.Password.obfuscate(char[] password)</code>. This * obfuscates the password using a simple and insecure XOR and Base64 encoding * mechanism. Note that this is only a simple scrambler to obfuscate clear-text * passwords.</dd> * * <dt>com.ibm.ssl.trustStoreType</dt> * <dd>The type of KeyStore object that you want the default TrustManager to * use. Same possible values as "keyStoreType".</dd> * * <dt>com.ibm.ssl.trustStoreProvider</dt> * <dd>Trust store provider, for example "IBMJCE" or "IBMJCEFIPS".</dd> * * <dt>com.ibm.ssl.enabledCipherSuites</dt> * <dd>A list of which ciphers are enabled. Values are dependent on the * provider, for example: * SSL_RSA_WITH_AES_128_CBC_SHA;SSL_RSA_WITH_3DES_EDE_CBC_SHA.</dd> * * <dt>com.ibm.ssl.keyManager</dt> * <dd>Sets the algorithm that will be used to instantiate a KeyManagerFactory * object instead of using the default algorithm available in the platform. * Example values: "IbmX509" or "IBMJ9X509".</dd> * * <dt>com.ibm.ssl.trustManager</dt> * <dd>Sets the algorithm that will be used to instantiate a TrustManagerFactory * object instead of using the default algorithm available in the platform. * Example values: "PKIX" or "IBMJ9X509".</dd> * </dl> * * @param props * The SSL {@link Properties} */
最新发布
08-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值