Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java¼ÓÃܺÍÊý×ÖÇ©Ãû2 ˽Կ¼ÓÃÜ

½ü³õ²½½Ó´¥ÁËÏÂJava¼ÓÃܺÍÊý×ÖÇ©ÃûµÄÏà¹ØÄÚÈÝ£¬ÎÒѧϰµÄ¹ý³Ì´ó¸Å·ÖÎå²½£º
1£©ÏûÏ¢ÕªÒª
2£©Ë½Ô¿¼ÓÃÜ
3£©¹«Ô¿¼ÓÃÜ
4£©Êý×ÖÇ©Ãû
5) Êý×ÖÖ¤Êé
ÏÂÃæµÄ´úÂëÊǵڶþ²¿·Ö£ºË½Ô¿¼ÓÃÜ
Ï£ÍûÄÜΪ¸Õ¸Õ½Ó´¥Õâ¸öµÄÅóÓÑÃÇÊ¡µãÊÂ
package security;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import java.security.Key;
/**
* ´ËÀý×ÓÊǶÔÒ»¸ö×Ö·û´®ÐÅÏ¢£¬ÓÃÒ»¸ö˽Կ(key)¼ÓÃÜ£¬È»ºóÔÚÓøÃ˽Կ½âÃÜ£¬ÑéÖ¤ÊÇ·ñÒ»ÖÂ
* ˽Կ¼ÓÃÜ£¬ÊǶԳƼÓÃÜ
* ʹÓöԳÆËã·¨¡£±ÈÈ磺AÓÃÒ»¸öÃÜÔ¿¶ÔÒ»¸öÎļþ¼ÓÃÜ£¬¶øB¶ÁÈ¡Õâ¸öÎļþµÄ»°£¬ÔòÐèÒªºÍAÒ»ÑùµÄÃÜÔ¿£¬Ë«·½¹²ÏíÒ»
* ¸ö˽Կ£¨¶øÔÚweb»·¾³Ï£¬Ë½Ô¿ÔÚ´«µÝʱÈÝÒ×±»ÕìÌý£©
*
* ¸½£ºÖ÷Òª¶Ô³ÆËã·¨ÓУºDES£¨Êµ¼ÊÃÜÔ¿Ö»Óõ½56 룩
* AES£¨Ö§³ÖÈýÖÖÃÜÔ¿³¤¶È£º128¡¢192¡¢256룩£¬Í¨³£Ê×ÏÈ128룬ÆäËûµÄ»¹ÓÐDESedeµÈ
*/
public class PrivateKey {
public static void main(String[] args) throws Exception {
String before = "asdf";
byte[] plainText = before.getBytes("UTF8");

//1²½**********************************************************************
System.out.println("Start generate AES key.");
//µÃµ½Ò»¸öʹÓÃAESËã·¨µÄKeyGeneratorµÄʵÀý
KeyGenerator keyGen = KeyGenerator.getInstance("AES");
//¶¨ÒåÃÜÔ¿³¤¶È128λ
keyGen.init(128);
//ͨ¹ýKeyGenerator²úÉúÒ»¸ökey£¨ÃÜÔ¿Ëã·¨¸Õ²ÅÒѶ¨Ò壬ΪAES£©
Key key = keyGen.generateKey();
System.out.println("Finish generating AES key."+key);

//2²½**********************************************************************
//»ñµÃÒ»¸ö˽Կ¼ÓÃÜÀàCipher£¬¶¨ÒåCipherµÄ»ù±¾ÐÅÏ¢£ºECBÊǼÓÃÜ·½Ê½£¬PKCS5PaddingÊÇÌî³ä·½·¨
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
// System.out.println("\n" + cipher.getProvider().getInfo());

//3²½**********************************************************************
//ʹÓÃ˽Կ¼ÓÃÜ
System.out.println("\nÓÃ˽Կ¼ÓÃÜ...");
//°Ñ¸Õ²ÅÉú³ÉµÄkeyµ±×÷²ÎÊý£¬³õʼ»¯Ê¹ÓøղŻñµÃµÄ˽Կ¼ÓÃÜÀ࣬Cipher.ENCRYPT_MODEÒâ˼ÊǼ


Ïà¹ØÎĵµ£º

JAVA¿ª·¢Õß×ȥµÄ20¸öÓ¢ÎÄÍøÕ¾

JAVA¿ª·¢Õß×ȥµÄ20¸öÓ¢ÎÄÍøÕ¾
1.[http://www.javaalmanac.com] – Java¿ª·¢ÕßÄê¼øÒ»ÊéµÄÔÚÏß°æ±¾. ÒªÏë¿ìËٲ鵽ijÖÖJava¼¼ÇɵÄÓ÷¨¼°Ê¾Àý´úÂë, ÕâÊÇÒ»¸ö²»´íµÄÈ¥´¦.
2.[http://www.onjava.com] – O’ReillyµÄJavaÍøÕ¾. ÿÖܶ¼ÓÐÐÂÎÄÕÂ.
3.[http://java.sun.com] – ¹Ù·½µÄJava¿ª·¢ÕßÍøÕ¾ &ndash ......

Java»ù´¡Æª£º£¨Ò»£©javaÈëÃÅ

1.       javaÊÇʲô
JavaÊÇÒ»ÖÖ±à³ÌÓïÑÔ£¬¸ú»ã±à¡¢C¡¢C++Ò»Ñù£¬ÊÇÓÃÓÚÈí¼þ±à³ÌµÄ¿ª·¢ÓïÑÔ¡£
JavaÊÇÒ»ÖÖ¿ª·¢¡¢ÔËÐл·¾³£¬java³ÌÐòµÄ¿ª·¢ÒªÒÀÀµÕâÖÖ»·¾³¡£
2.       javaµÄÌØµã
javaÓïÑÔ¾ßÓÐÓëÆ½Ì¨Î޹أ¬ÃæÏò¶ÔÏ󣬽¡×³ÐÔµÄÌØµã
1).ÓëÆ½Ì¨µÄÎÞ¹ØÐÔ
Óëjav ......

java µÄÖÐ½× servlet Rubicon

Ó¦¸Ã¾ÍÊǰÑjava ÀïÃæµÄ×é¼þ¸ãÃ÷°×
Servlet
ServletÊÇÒ»ÖÖ»ùÓÚwebµÄJava×é¼þ£¬ËüÓÉÈÝÆ÷¹ÜÀí£¬²¢¶¯Ì¬Éú³ÉÆäÄÚÈÝ
ÔòûÓÐͼÐνçÃæ£¬ÔËÐÐÔÚ·þÎñÆ÷¶Ë
ËüÃǶ¼ÓÐÒ»¸öÉú´æÖÜÆÚ£¬°üº¬init()ºÍdestroy()·½·¨
 ²»ÊǶÀÁ¢µÄÓ¦ÓóÌÐò£¬Ã»ÓÐmain()·½·¨
Ó봫ͳµÄCGIºÍÐí¶àÆäËûÀàËÆCGIµÄ¼¼ÊõÏà±È£¬Java Servlet¾ßÓиü¸ßµÄЧÂÊ£¬¸ ......

JavaÓëÆäËûÓïÑԵĻ¥²Ù×÷ÐÔ

JavaÓëÆäËûÓïÑԵĻ¥²Ù×÷ÐÔ ÊÕ²Ø
Ŀǰ£¬ÎÒÃÇÏîÄ¿ÖÐÐèÒªÓõ½°ÑJava³ÌÐòǶÈëµ½.Net³ÌÐòÖеļ¼Êõ£¬ÎÒÃÇ×îºóËù²ÉÓõļ¼ÊõÊÇCodemesh¹«Ë¾µÄJuggerNET¡£ÕâÖÖÀàËÆµÄ¼¼ÊõºÜ¶à£¬±È½ÏÖªÃûµÄÖ÷ÒªÓÐintrinsyc¹«Ë¾µÄJIntegraÒÔ¼°IBMµÄJava COM bridge¡£
ÏîÄ¿½øÐе½ÏÖÔÚ£¬·¢ÏÖÁ˺ܶàÎÊÌ⣬Ö÷ÒªÓÐÈçϼ¸´óÀàÎÊÌ⣺
1¡¢µ¯³ö´°¿ÚÎÊÌâ
¶ÔÓ ......

JAVA ²ÊƱ³ÌÐò

import java.io.*;
public class CaiPiao {
 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  String str;
  BufferedReader bufferReader = new BufferedReader(new InputStreamReader(System.in ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ