`
yaodaqing
  • 浏览: 345697 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论
文章列表
package com.digican.books.a0102.b0101; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.math.BigInteger; import java.security.KeyPair; import java.security.KeyPairGenerator; import java.securi ...
Java安全性编程实例 目 录 第1章运行环境设置 1 1.1 J2SE的安装和设置 1 1.1.1下载J2SE 1 1.1.2安装J2SE 1 1.1.3设置J2SE 3 2.1.4 J2SE的主要工具 4 1.2反编译器的安装 5 1.3 混淆器的安装 7 第2章数据内容的保护—— 加密和解密 8 2.1一个简单的加密和解密程序——凯撒密码 8 2.2对称密钥的生成和保存 10 2.2.1对称密钥的生成及以对象序列化方式保存 11 2.2.2以字节保存对称密钥 12 2.3使用对称密钥进行加密和解密 14 2.3.1使用对称密钥进行加密 14 2. ...
/** * 获取JAVA中有多少种加密方式 * RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC */ public static void getMethod() throws Exception{ KeyGenerator kg = KeyGenerator.getInstance("AES"); kg.init(128); System.out.println(kg.getProvider().getInfo()); } ...
/** * 自动产生RSA512位密钥(可以在512到2048之间) */ public static void getA271() throws Exception{ KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA"); kpg.initialize(512); KeyPair kp = kpg.genKeyPair(); PublicKey puk = kp.getPublic(); PrivateKey prk = kp.getPrivate(); ...
/** * 自动生成AES128位密钥 */ public static void getA221(){ try { KeyGenerator kg = KeyGenerator.getInstance("AES"); kg.init(128);//要生成多少位,只需要修改这里即可128, 192或256 SecretKey sk = kg.generateKey(); byte[] b = sk.getEncoded(); String s = byteToHexString(b); System.o ...

凯撒密码

/** * 凯撒密码 */ public static void getA21(){ String s = "hello word";/* 明文 */ int key=Integer.parseInt("2");/* 密钥 */ String es=""; for(int i=0;i<s.length( );i++){ char c=s.charAt(i); if(c>='a' && ...
2010-8-19 15:34:22 org.apache.catalina.core.AprLifecycleListener init 信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\develop\Java\jdk1.6.0_11\bin;C:\develop\Tomcat\bin 2010-8-19 15:34:22 org.apache.coyote ...
//JSP提交页面代码 <form action="upload/result.jsp" method="post" enctype="multipart/form-data"> Information:<input type="text" name="info"><br> File:<input type="file" name="file"><br> & ...
import java.net.URLDecoder; public class URL { /** * 解码应用案例 * @param args * @throws Exception */ public static void main(String[] args) throws Exception{ String str = "C%3A%5CDocuments+and+Settings%5CAdministrator%5C%E6%A1%8C%E9%9D%A2%5Cother.txt"; String result ...
2010-8-17 17:11:10 org.apache.catalina.core.AprLifecycleListener init 信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\develop\Java\jdk1.6.0_11\bin;C:\develop\Tomcat\bin 2010-8-17 17:11:10 org.apache.coyote ...

MySQL表中字段

序号 表字段属性 意思 1 tinyint 2 smallint 3 mediumint 4 int 5 integer 6 bigint 7 bit 8 real 9 double 10 float 11 decimal 12 numeric 13 char 14 varchar 15 date 16 time 17 year 18 timestamp 19 datetime 20 tinyblob 21 blob 22 mediumblob 23 long ...
package com.daqing.test; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Date; import com.daqing.jdbc.A0101JdbcUtils; public class DateTest { private static Connection conn = null; private st ...
package com.daqing.test; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import com.daqing.jdbc.A0101JdbcUtils; public class TestRead01 { private Connection conn = null; private Pre ...
package com.daqing.jdbc; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; /** * 单例模式会有一个实例;会new一次 * 单例模式不使用静态的 * A0102JdbcUtilsSingletonRetard * 意思:jdbc工具类,单例,延迟加载就是用到的时候再new ...
package com.daqing.jdbc; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; /** * 单例模式会有一个实例;会new一次 * 单例模式不使用静态的 * A0102JdbcUtilsSingletonBeforehand * 意思:jdbc工具类,单例,预先初始化 * @aut ...
Global site tag (gtag.js) - Google Analytics