200分求 DES 数据加密 java 算法源程序
本文导语: 200分求 DES 数据加密 java 算法源程序 | 哥们,我这里有N多种加密算法java源程序,先加分,我给你发过去。我先给你贴出来一部分:) /* * Copyright (c) 1995, 1996, 1997 Systemics Ltd * on beha...
|
/*
* Copyright (c) 1995, 1996, 1997 Systemics Ltd
* on behalf of the Cryptix Development Team. All rights reserved.
*/
package cryptix.security;
import java.io.PrintStream;
/**
* DES is a block cipher with an 8 byte block size. The key length
* is 8 bytes, but only 56 bits are used as the parity bit in each
* byte is ignored.
*
* This algorithm has been seriously analysed over the last 30 years,
* and no significant weaknesses have been reported. It's only flaw
* is that the key length of 56 bits makes it relatively easy to
* brute-force it. To overcome this near-fatal flaw, it is recommended
* that DES be used in triple-DES mode. Need reference here...
*
*
* References
*
*
* DES was written by IBM and first released in 1976.
* See
* Bruce Schneier,
* "Chapter 12 Data Encryption Standard,"
* Applied Cryptography,
* Wiley 2nd Ed, 1996
* for detailed information. The algorithm is freely usable.
*
*
* Copyright © 1995, 1996, 1997
* Systemics Ltd
* on behalf of the
*
* Cryptix Development Team.
* All rights reserved.
*
*
* @author Geoffrey Keating (this Java implementation)
* @author Eric Young (SPtrans)
* @see BlockCipher
*/
public final class DES extends BlockCipher
{
private static final int REQUIRED_LIB_MAJOR_VER = 1;
private static final int REQUIRED_LIB_MINOR_VER = 11;
private static final String LIBRARY_NAME = "des";
private static boolean native_link_ok = false;
private static boolean native_lib_loaded = false;
private static String native_link_err = "Class never loaded";
static
{
// load the DLL or shared library that contains the native code
// implementation of the des block cipher.
try
{
System.loadLibrary( LIBRARY_NAME );
native_lib_loaded = true;
try
{
if ( ( getLibMajorVersion() != REQUIRED_LIB_MAJOR_VER ) ||
( getLibMinorVersion()