ÓÃjavaÍê³ÉC#ͬÑùµÄDES¶Ô³Æ¼ÓÃÜ
ÔÚÒ»¸öÏîÄ¿ÖУ¬¿Í»§ÓÃC#ʵÏÖÁËDES¼ÓÃÜ£¬ÓÉÓÚÐèÒªºÍjava·½ÃæµÄ³ÌÐò½øÐÐÊý¾Ý½»»¥£¬ËùÒÔ±ØÐëÅäºÏ½øÐмӽâÃܹ¤×÷¡£¿Í»§ÌṩÁËÃÜÔ¿ºÍÏòÁ¿£¬ÎÒ¿´ÁË¿´´úÂ룬c#×öÕâ¸öÊÂÇ黹Âù¼òµ¥¡£ ÓÃjavaʵÏֹؼüÊÇÎÒ²»×Ö¶ÎÔõôÉèÖÃÏòÁ¿£¬Ò»°ãÓÃCipher¶ÔÏó¶¼ÊÇĬÈÏËæ»úÏòÁ¿¡£¸ãÁËÒ»Õ󣬷¢ÏÖÊÇÓÃIvParameterSpecÕâ¸öÀàÀ´ÉèÖá£ÓÚÊÇÓÐÁËÒÔÏ´úÂë
Code
import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;
import javax.crypto.*;
import javax.crypto.spec.DESKeySpec;
import javax.crypto.spec.IvParameterSpec;
import java.security.Key;
import java.security.spec.AlgorithmParameterSpec;
/**
* ʹÓÃDES¼ÓÃܺͽâÃܵķ½·¨
* @author:azhong
*User: Administrator
* Date: 2007-10-27
* Time: 10:54:36
* */
public class CryptoTools {
private final byte [] DESkey = {};//ÉèÖÃÃÜÔ¿£¬ÂÔÈ¥
private final byte[] DESIV = {};//ÉèÖÃÏòÁ¿£¬ÂÔÈ¥
private AlgorithmParameterSpec iv =null;//¼ÓÃÜËã·¨µÄ²ÎÊý½Ó¿Ú£¬IvParameterSpecÊÇËüµÄÒ»¸öʵÏÖ
private Key key =null;
public CryptoTools() throws Exception {
DESKeySpec keySpec = new DESKeySpec(DESkey);//ÉèÖÃÃÜÔ¿²ÎÊý
iv = new IvParameterSpec(DESIV);//ÉèÖÃÏòÁ¿
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");//»ñµÃÃÜÔ¿¹¤³§
key = keyFactory.generateSecret(keySpec);//µÃµ½ÃÜÔ¿¶ÔÏó
}
public String encode(String data) throws Exception {
&nbs
Ïà¹ØÎĵµ£º
System.out.println(2|0); //0010 0000 =>0010 = 2
System.out.println(2|1); //0010 0001 =>0011 = 3
System.out.println(3|2); //0011 0010 =>0011 = 3
System.out.println(3&2); //0011 0010 =>0010 = 2
/*
ÔÚjavaÖÐ0´ú±í¼Ù, 1´ú±íÕæ
00011|0010 ´ÓÓÒµ½×ó±È½Ï0|1 = 1, 1|0 = ......
JAVA¿ª·¢Õß×ȥµÄ20¸öÓ¢ÎÄÍøÕ¾
2009Äê09ÔÂ01ÈÕ 09:56 ·ÖÀࣺJava×ÊѶ ä¯ÀÀ£º 33,388 ´Î
JAVA¿ª·¢Õß×ȥµÄ20¸öÓ¢ÎÄÍøÕ¾
1.[http://www.javaalmanac.com] – Java¿ª·¢ÕßÄê¼øÒ»ÊéµÄÔÚÏß°æ±¾. ÒªÏë¿ìËٲ鵽ijÖÖJava¼¼ÇɵÄÓ÷¨¼°Ê¾Àý´úÂë, ÕâÊÇÒ»¸ö²»´íµÄÈ¥ ......
Ŀ ¼
1 ¼¯ºÏ¿ò¼Ü... 2
1.1 ¼¯ºÏ¿ò¼Ü¸ÅÊö... 2
1.1.1 ÈÝÆ÷¼ò½é... 2
1.1.2 ÈÝÆ÷µÄ·ÖÀà... 4
1.2 Collection. 5
1.2.1  ......
ǰÑÔ£ºÇ°¶Îʱ¼äÔÚCSDNµÄC++ÉçÇøÓöµ½Ò»¸öÐèÒª·â×°¿¼ÇÚ»ú½Ó¿ÚµÄ¶¯Ì¬¿â¸øJAVAµ÷ÓõÄÌû×Ó£¬¹´ÆðÁËÎÒ¶ÔJAVAµÄÎÞÏÞ»³Äî¡£ÔÚ´Ë£¬ÎÒÏë°ÑÕâÏî¼¼Êõ¼òµ¥ÔÙ½éÉÜһϡ£
Ò»¡¢¹ØÓÚJava Native Interface (JNI)
JNIÊÇJAVA±¾µØ±à³Ì½Ó¿Ú£¬ÊôÓÚJDKµÄÒ»²¿·Ö¡£ËüÔÊÐíJAVAÄܹ»²Ù×÷±¾µØAPI»òÓÉÆäËûÓïÑÔ±àдµÄ¶¯Ì¬¿â¡£²»¹ýµ±ÄãʹÓÃÕâÏî¼¼ÊõµÄʱºò£ ......
¹¤³ÌĿ¼½á¹¹ÈçÏ£º
HStudy
--src
--jvm
&nbs ......