⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hashmac.java

📁 JAVA的加密源程序
💻 JAVA
字号:
/*Christoforos Pirillos @ Villanova University - May 1999based on code from the book "Java Network Programming" by Hughes*/package encryption;/** Message Authentication Code. It takes an existing hash algorithm andencryption algorithm and combines them to form a MAC*/public class HashMAC extends Hash {protected Hash h;protected Cipher c;public HashMAC (Hash h, Cipher c) {	this.h = h;	this.c = c;}public byte[] digest (byte[] text, int off, int len) {	byte[] hash = h.digest (text, off, len);	return c.encipher (hash, 0, Math.min (hash.length,c.blockSize()));}public int digestSize () {	return c.blockSize();}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -