亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? desmac.java

?? 面向應用的智能安全代理平臺和工具包是一個綜合網絡應用的安全共性需求而設計和實現的一個通用性的網絡信息安全應用支撐平臺
?? JAVA
字號:
package au.net.aba.crypto.provider;

/*
 * $Id: DESMac.java,v 1.1 1999/02/11 04:32:51 leachbj Exp $
 * $Author: leachbj $
 *
 * Copyright (C) 1996-1998 Australian Business Access Pty Ltd.
 * All rights reserved.
 * 
 * Use, modification, copying and distribution of this software is subject the
 * terms and conditions of the ABA Public Licence. See the file
 * "PUBLIC_LICENCE" for additional information.
 *
 * If you have not received a copy of the Public Licence, you must destroy all
 * copies of this file immediately. 
 *
 * $Source: /aba/CVSROOT/jdk1.1/src/au.net.aba/crypto/provider/DESMac.java,v $
 * $Revision: 1.1 $
 * $Date: 1999/02/11 04:32:51 $
 * $State: Exp $
 */

import java.security.*;
import javax.crypto.*;
import javax.crypto.spec.*;

import java.security.*;
import java.security.spec.*;

/**
 * This class implements the DES based MAC algorithm as defined in
 * <a href="http://www.itl.nist.gov/div897/pubs/fip113.htm">FIPS PUB 113</a>.
 * <p>
 * This algorithm produces a 4 byte MAC value.
 * <p>
 * Currently this class will not work correctly unless the input data
 * size is an exact multiple of 8.  Data that isnt of this length
 * should be padded with zeros.  Eventually the DES cipher class
 * will be modified to perform this function.
 */
public class DESMac extends MacSpi
{
	private static final int MAC_LENGTH = 4;
	private static final int MAC_BUFFER = 8;

	// private static final String MAC_ALG = "DES/CBC/Zeroes";
	private static final String MAC_ALG = "DES/CBC/NoPadding";
	private static final String MAC_PROV = "ABA";

	private Cipher desCipher;
	private byte[] inbuf;
	private byte[] mac;

	/**
	 * Default constructor, initialises the instance.
	 */
	public DESMac()
	{
		inbuf = new byte[1];
		mac = new byte[MAC_BUFFER];
	}
	/**
	 * Completes the MAC computation and resets the MAC for further
	 * use, maintaining the secret key that the MAC was initialised with.
	 *
	 * @return the MAC result.
	 */
	protected byte[] engineDoFinal()
	{
		try
		{
			byte[] out = desCipher.doFinal();
			updateMac(out);
		}
		catch (BadPaddingException bpe)
		{
			bpe.printStackTrace();
		}
		catch (IllegalBlockSizeException ibse)
		{
			ibse.printStackTrace();
		}

		byte[] result = new byte[MAC_LENGTH];
		System.arraycopy(mac, 0, result, 0, MAC_LENGTH);

		return result;
	}
	/**
	 * Returns the length of the MAC in bytes.
	 *
	 * @return the MAC length in bytes.
	 */
	protected int engineGetMacLength()
	{
		return MAC_LENGTH;
	}
	/**
	 * Initialises the MAC with the given (secret) key and algorithm
	 * parameters.  The <code>key</code> parameter should be a
	 * type that is compatible with the DES <code>Cipher</code>.
	 *
	 * @param key the (secret) key. 
	 * @param params the algorithm parameters. 
	 *
	 * @exception InvalidKeyException if the given key is inappropriate for
	 *     initialising this MAC.
	 * @exception InvalidAlgorithmParameterException if the given algorithm
	 *     parameters are inappropriate for this MAC.
	 */
	protected void engineInit(Key key, AlgorithmParameterSpec params)
		throws InvalidKeyException, InvalidAlgorithmParameterException
	{
		try
		{
			desCipher = Cipher.getInstance(MAC_ALG, MAC_PROV);
		}
		catch (Exception e)
		{
			throw new ExceptionInInitializerError(e);
		}

		byte[] iv = new byte[desCipher.getBlockSize()];
		IvParameterSpec ivParam = new IvParameterSpec(iv);

		desCipher.init(Cipher.ENCRYPT_MODE, key, ivParam);
		mac = new byte[MAC_BUFFER];
	}
	/**
	 * Resets the MAC for further use, maintaining the secret key that
	 * the MAC was initialised with.
	 */
	protected void engineReset()
	{
		mac = new byte[MAC_BUFFER];
		if (desCipher != null)
		{
			try
			{
				desCipher.doFinal();
			}
			catch (Exception e)
			{
				// ignore it
			}
		}
	}
	/**
	 * Processes the first len bytes in input, starting at offset.
	 *
	 * @param input the input buffer.
	 * @param offset the offset in input where the input starts. 
	 * @param len the number of bytes to process. 
	 */
	protected void engineUpdate(byte[] input, int offset, int len)
	{
		byte[] out = desCipher.update(input, offset, len);
		updateMac(out);
	}
	/**
	 * Processes the given byte.
	 *
	 * @param input the input byte to be processed.
	 */
	protected void engineUpdate(byte input)
	{
		inbuf[0] = input;
		byte[] out = desCipher.update(inbuf);
		updateMac(out);
	}
	/**
	 * This method will add the newbuf bytes on the the mac.  The
	 * MAC result is stored in a circular type buffer, as new data
	 * arrives it is appended to the buffer and old data is shifted
	 * out so that the last 4 bytes of the cipher are saved.
	 */
	private void updateMac(byte[] newbuf)
	{
		if (newbuf == null || newbuf.length == 0)
		{
			return;
		}

		if (newbuf.length == MAC_BUFFER)
		{
			System.arraycopy(newbuf, 0, mac, 0, MAC_BUFFER);
		}
		else if (newbuf.length > MAC_BUFFER)
		{
			System.arraycopy(newbuf, newbuf.length - MAC_BUFFER,
				mac, 0, MAC_BUFFER);
		}
		else
		{
			System.arraycopy(mac, newbuf.length, mac, 0,
				MAC_BUFFER - newbuf.length);
			System.arraycopy(newbuf, 0, mac,
				MAC_BUFFER - newbuf.length, newbuf.length);
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99国产一区二区三精品乱码| 欧美猛男gaygay网站| 亚洲国产日韩a在线播放性色| 欧美大尺度电影在线| av中文字幕亚洲| 精品一区二区三区免费毛片爱 | 成人综合在线视频| 丝袜脚交一区二区| 亚洲黄色尤物视频| 久久精品免费在线观看| 欧美一二三四在线| 色噜噜狠狠色综合欧洲selulu| 久久99热99| 亚洲一区欧美一区| 中文字幕一区二区三| 精品久久久久久无| 欧美丰满高潮xxxx喷水动漫| 91农村精品一区二区在线| 国产福利一区在线| 精品一区二区三区在线视频| 婷婷中文字幕一区三区| 一区二区日韩av| 亚洲精品欧美激情| 亚洲丝袜精品丝袜在线| 国产精品不卡视频| 国产精品福利一区二区| 国产片一区二区| 久久九九影视网| 久久精品视频一区二区三区| 日韩三区在线观看| 欧美一区二区美女| 欧美日韩一区二区欧美激情| 欧美日韩一区二区三区视频| 欧美午夜精品一区二区三区| 91久久国产最好的精华液| 日本久久一区二区| 在线一区二区三区四区| 国产精品久久久久久久久果冻传媒 | 日日夜夜一区二区| 香蕉久久夜色精品国产使用方法 | 亚洲图片自拍偷拍| 亚洲综合在线观看视频| 一区二区三区美女| 亚洲最新视频在线播放| 一个色综合网站| 亚洲动漫第一页| 日韩av中文字幕一区二区三区| 肉色丝袜一区二区| 久久成人综合网| 国产一区久久久| 国产suv一区二区三区88区| 福利一区二区在线观看| 91免费视频大全| 在线观看视频91| 欧美一区二区三区小说| 久久久三级国产网站| 国产精品美女久久久久久| 亚洲女爱视频在线| 日本欧美在线观看| 国产精品一区二区91| av男人天堂一区| 在线观看国产日韩| 欧美一卡二卡三卡| 国产亚洲精品精华液| 亚洲欧美一区二区久久| 午夜天堂影视香蕉久久| 久久99国产精品麻豆| 99久久精品免费看| 欧美精品粉嫩高潮一区二区| 337p粉嫩大胆色噜噜噜噜亚洲| 国产精品久久99| 日韩成人伦理电影在线观看| 国产精品自产自拍| 日本精品一区二区三区高清 | 久久久亚洲午夜电影| 亚洲日本在线视频观看| 日韩在线一区二区| 岛国一区二区三区| 欧美久久久久久久久久| 久久久久国产精品免费免费搜索| 中文字幕亚洲在| 免费高清在线视频一区·| jlzzjlzz亚洲日本少妇| 69堂精品视频| 亚洲国产成人午夜在线一区| 91在线码无精品| 欧美一二区视频| 亚洲精品乱码久久久久久黑人 | 白白色 亚洲乱淫| 欧美日本精品一区二区三区| 久久综合久久久久88| 亚洲va欧美va人人爽| 国产高清久久久久| 夜夜精品浪潮av一区二区三区| 日本大胆欧美人术艺术动态| 91精品在线一区二区| 在线一区二区视频| 久久九九99视频| 天天色图综合网| 91首页免费视频| 久久综合色8888| 日韩av高清在线观看| 91网站最新网址| 国产偷国产偷精品高清尤物| 日韩av网站在线观看| 91高清视频在线| 国产精品久久久爽爽爽麻豆色哟哟| 日本不卡一区二区| 色8久久人人97超碰香蕉987| 中文字幕第一区二区| 久久精品国产免费看久久精品| 欧美亚洲动漫精品| 亚洲色图欧洲色图| www..com久久爱| 国产精品蜜臀av| 成人综合婷婷国产精品久久免费| 亚洲精品一区二区三区福利| 污片在线观看一区二区| 欧美三级日韩三级| 亚洲女人****多毛耸耸8| jlzzjlzz亚洲女人18| 国产精品久久久久久久久晋中 | 91亚洲国产成人精品一区二三| 久久久精品tv| 国产精品一线二线三线| 精品精品国产高清a毛片牛牛| 91麻豆高清视频| 亚洲天天做日日做天天谢日日欢| 成人小视频在线观看| 国产精品午夜春色av| 国产69精品久久久久777| 国产欧美日本一区二区三区| 韩日欧美一区二区三区| 2017欧美狠狠色| 国产成人啪免费观看软件| 欧美精品一区二区三区蜜臀| 精品一区二区在线播放| 久久日韩粉嫩一区二区三区| 国内一区二区视频| 久久美女艺术照精彩视频福利播放 | 福利一区二区在线观看| 国产喷白浆一区二区三区| 粉嫩在线一区二区三区视频| 国产精品狼人久久影院观看方式| 91亚洲精品乱码久久久久久蜜桃| 一区二区三区在线观看国产| 91豆麻精品91久久久久久| 香港成人在线视频| 日韩美女视频一区二区在线观看| 久久精品国产99国产| 久久日韩粉嫩一区二区三区| 成人黄色电影在线| 亚洲一区自拍偷拍| 欧美一区二区在线观看| 韩国毛片一区二区三区| 国产精品水嫩水嫩| 色素色在线综合| 亚洲不卡av一区二区三区| 天堂av在线一区| 日韩欧美国产午夜精品| 国产精品夜夜爽| 亚洲少妇中出一区| 欧美高清精品3d| 国产乱码精品一区二区三区av| 亚洲国产成人私人影院tom| 欧美在线不卡一区| 精品一区二区影视| 亚洲美女少妇撒尿| 欧美一级精品大片| 波多野洁衣一区| 天堂在线一区二区| 国产网站一区二区| 欧美日产国产精品| 国产精品66部| 亚洲午夜免费电影| 久久久.com| 欧美男人的天堂一二区| 国产乱理伦片在线观看夜一区| 亚洲色图欧美激情| 精品国产亚洲在线| 91黄色免费网站| 国产精品69久久久久水密桃| 午夜视频一区二区三区| 久久久久国产成人精品亚洲午夜| 91免费国产在线| 韩国成人在线视频| 亚洲国产另类av| 国产精品色哟哟网站| 欧美va天堂va视频va在线| 在线免费一区三区| 岛国一区二区在线观看| 麻豆91在线看| 亚洲一区二区视频在线| 国产精品乱人伦| 精品国产污网站| 欧美色图一区二区三区| 成人avav影音| 狠狠色综合日日| 免费视频最近日韩| 亚洲一区中文日韩|