什么是混沌系统?

一种非线性系统,什么是非线性?

比较典型的混沌系统?
Logistic 混沌映射
Logistic 混沌映射是一个多项式映射,它作为一个由非常简单的非线性动力学方程产生非常复杂而混沌的结果的经典例子,而经常被引用。该混沌映射最初是由生物学家 RobertMay 1976 年的一份创新性文件中,以一个和皮埃尔 · 弗朗索瓦 · 弗赫尔斯特所创的 Logistic 方程类似的离散人口模型的形式来推广的。
 
计算公式?
Logistic 映射法生成混沌数据利用如下公式实现
 
 
 

 

代码设计如下:

 

package com.cuit.hundun;

import java.io.*;
import java.math.BigDecimal;
import java.util.Arrays;

public class Chaos
{

	//懒汉式(单例模式)
	private static Chaos chaos = null;
	
	private Chaos(){}
	
	public static Chaos getInstance()
	{
		if(chaos == null)
		{
			//防止线程同步问题,这种方式可以提高性能
			synchronized(Chaos.class)
			{
				if(chaos == null)
				{
					chaos = new Chaos();
				}
			}
		}
		return chaos;
	}
	
	//得到明文byte[]
	public byte[] getPlaintextOfBytes(String filePath)
	{
		byte[] plaintextOfBytes = null;
		byte[] b = new byte[1024];
		InputStream is = null;
		
		if(filePath == null)
		{
			return null;
		}
		try
		{
			is = new FileInputStream(filePath);
			int byteRead,count=0;
			while((byteRead = is.read()) != -1)
			{
				b[count++] = (byte) byteRead;
				if(count%1024 ==0)
				{
					Arrays.copyOf(b, 1024*(count%1024+1));
				}
			}
			plaintextOfBytes = new byte[count];
			for(int i=0; i 0.5)
				tt += 128;
			if(temp[j+1].doubleValue() > 0.5)
				tt += 64;
			if(temp[j+2].doubleValue() > 0.5)
				tt += 32;
			if(temp[j+3].doubleValue() > 0.5)
				tt += 16;
			if(temp[j+4].doubleValue() > 0.5)
				tt += 8;
			if(temp[j+5].doubleValue() > 0.5)
				tt += 4;
			if(temp[j+6].doubleValue() > 0.5)
				tt += 2;
			if(temp[j+7].doubleValue() > 0.5)
				tt += 1;
			key[i-1] = (byte)(tt&0xff);
		}
		return key;
	}
	
	//加密
	public byte[] encrypt(byte[] plaintextOfBytes,byte[] key)
	{
		int length = plaintextOfBytes.length;
		byte[] ciphertestOfBytes = new byte[length];
		for(int i=0; i 
  


 

封装的也许不是很好,希望对大家学习有帮助