解密參考:
創(chuàng)新互聯(lián)公司專注于靜安網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠(chéng)為您提供靜安營(yíng)銷型網(wǎng)站建設(shè),靜安網(wǎng)站制作、靜安網(wǎng)頁(yè)設(shè)計(jì)、靜安網(wǎng)站官網(wǎng)定制、重慶小程序開(kāi)發(fā)服務(wù),打造靜安網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供靜安網(wǎng)站排名全網(wǎng)營(yíng)銷落地服務(wù)。
//http://blog.csdn.net/njweiyukun/article/details/54024442 //imei號(hào):手機(jī)按*#06#,CompatibleInfo.cfg 354169060462426 c4cc03c //sqlite jdbc:https://bitbucket.org/xerial/sqlite-jdbc/downloads/ import java.io.UnsupportedEncodingException; import java.text.SimpleDateFormat; import java.util.Date; import java.security.MessageDigest; class Ex02_3_3 { //md5 加密3 public static String md5(String content) { MessageDigest md5 = null; try { md5 = MessageDigest.getInstance("MD5"); md5.update(content.getBytes("UTF-8")); byte[] encryption = md5.digest();//加密 StringBuffer sb = new StringBuffer(); for (int i = 0; i < encryption.length; i++) { if (Integer.toHexString(0xff & encryption[i]).length() == 1) { sb.append("0").append(Integer.toHexString(0xff & encryption[i])); } else { sb.append(Integer.toHexString(0xff & encryption[i])); } } return sb.toString(); } catch (Exception e) { e.printStackTrace(); return null; } } //日期打印到毫秒 public static void display() { System.out.println(new SimpleDateFormat("yyyy/MM/dd KK:mm:ss:SSS").format(new Date())); } //注冊(cè)數(shù)據(jù)庫(kù) public Connection getConnection() throws ClassNotFoundException,IOException, SQLException { Class.forName("org.sqlite.JDBC"); return DriverManager.getConnection("jdbc:sqlite:enmicromsg.db"); } public static void main(String args[]) { // String imei="354169060462426"; Connection conn = null; String imei=args[0]; //String uin="1297173361"; String uin=args[1]; Mynumber a= new Mynumber(); // a.number= 5; System.out.println(imei+uin); String md5 = md5(imei + uin); String password = md5.substring(0, 7).toLowerCase(); String sql="select count(*) from message'; display(); Statement stmt = conn.createStatement; ResultSet rs = stmt.executeQuery(sql); System.out.println(password); } }
運(yùn)行
D:\javasource>java Ex02_3_3 354169060462426 1297173361 3541690604624261297173361 2017/08/13 08:02:02:640 c4cc03c
message查詢:
select datetime(createTime/1000 ,'unixepoch','localtime'), createtime,content from message where talker='ha**ong00'