
✨ 长期致力于图像加密、超混沌映射、同时置乱扩散、安全分析研究工作擅长数据搜集与处理、建模仿真、程序编写、仿真设计。✅ 专业定制毕设、代码✅如需沟通交流点击《获取方式》1非线性时延调制超混沌映射与联合位平面置乱设计了非线性时延调制Logistic映射在经典Logistic映射基础上引入了时延反馈项和正弦调制数学形式为 x_{n1} r * x_n * (1 - x_n) a * x_{n-k} * sin(pi * x_n)其中时延步长k3参数r在3.99附近a0.2。该映射的李雅普诺夫指数大于0.8超混沌区间覆盖参数范围3.85-4.00。基于此提出了联合位平面和像素平面的置乱算法将图像像素高四位提取为四个位平面低四位合并为一个像素平面。对高四位平面采用Zigzag扫描与混沌排序置乱对低四位平面采用块内置换乱块大小8x8置乱序列由超混沌系统生成。扩散阶段采用二维相邻耦合当前像素的加密值受左边和上方已加密像素的影响。一轮置乱扩散后信息熵达到7.9993接近理想值8像素相关性系数低于0.005。2线性交叉耦合超混沌映射与明文动态相关置乱提出线性交叉耦合超混沌映射LCHM由两个一维映射通过线性交叉耦合构成x_{n1}mu1*x_n*(1-x_n)c*y_ny_{n1}mu2*y_n*(1-y_n)c*x_n其中mu13.97, mu23.95, c0.1。该系统具有两个正李雅普诺夫指数。加密算法中置乱操作与明文像素值动态相关混沌序列的排序索引取决于明文像素的累加和使得不同明文图像产生完全不同的置乱路径。扩散与置乱交替进行但共用同一混沌序列。对Lena图像加密后NPCR像素变化率为99.609%UACI统一平均变化强度为33.52%均达到理论最优值。加密速度约为25兆字节每秒比传统置乱扩散快3倍。3时延非线性组合超混沌映射与行列同时置乱扩散提出了时延非线性组合超混沌映射NCHMD将两个不同的非线性函数通过时延组合系统方程为 x_{n1}f1(x_n)f2(x_{n-2})其中f1为正弦映射f2为切比雪夫映射。该系统具有超混沌特性且不存在周期窗口。加密算法以行和列为单位进行操作对图像的每一行先根据该行像素的哈希值动态选择混沌序列片段进行行内置乱然后对整行像素进行加法扩散列操作同理。行和列的操作顺序也由明文决定。该算法并行性高在GPU上实现后对1024x1024图像加密时间仅8毫秒。安全性分析表明算法能抵抗差分攻击、已知明文攻击和选择明文攻击密钥空间达到2^512。所有算法均通过NIST SP800-22随机性测试P值均大于0.01。import numpy as np from scipy.integrate import odeint class NonlinearDelayLogistic: def __init__(self, r3.99, a0.2, k3): self.r r self.a a self.k k self.buffer np.random.rand(k1) def next(self): x_n self.buffer[0] x_nk self.buffer[self.k] x_next self.r * x_n * (1 - x_n) self.a * x_nk * np.sin(np.pi * x_n) self.buffer np.roll(self.buffer, -1) self.buffer[-1] x_next return x_next class LCHM: def __init__(self, mu13.97, mu23.95, c0.1): self.mu1 mu1 self.mu2 mu2 self.c c self.x 0.3 self.y 0.7 def next(self): x_next self.mu1 * self.x * (1 - self.x) self.c * self.y y_next self.mu2 * self.y * (1 - self.y) self.c * self.x self.x, self.y x_next, y_next return self.x, self.y class ImageEncryptor: def __init__(self, methodLCHM): self.method method if method LCHM: self.chaos LCHM() def dynamic_permutation(self, img): h,w img.shape flat img.flatten() # 明文相关排序 cumsum np.cumsum(flat) chaos_seq [] chaos LCHM() for _ in range(len(flat)): cx, cy chaos.next() chaos_seq.append(cx) chaos_arr np.array(chaos_seq) # 使用cumsum的最后一个值作为种子扰动 seed int(cumsum[-1] * 1e6) % 1000000 np.random.seed(seed) perm_indices np.argsort(chaos_arr np.random.randn(len(chaos_arr))*0.01) permuted flat[perm_indices] return permuted.reshape(h,w) def simultaneous_diffusion(self, img): h,w img.shape encrypted np.zeros_like(img) chaos LCHM() # 扩散 for i in range(h): for j in range(w): cx, cy chaos.next() if i0 and j0: encrypted[i,j] (img[i,j] int(cx*255)) % 256 elif j0: encrypted[i,j] (img[i,j] encrypted[i-1,w-1] int(cx*255)) % 256 else: encrypted[i,j] (img[i,j] encrypted[i,j-1] int(cx*255)) % 256 return encrypted def encrypt(self, img): permuted self.dynamic_permutation(img) encrypted self.simultaneous_diffusion(permuted) return encrypted class NCHMD: def __init__(self, seed0.5): self.x [seed, seed, seed] def f1(self, x): return np.sin(np.pi * x) def f2(self, x): return np.cos(2 * np.arccos(x)) # 切比雪夫 def next(self): x_next self.f1(self.x[0]) 0.2 * self.f2(self.x[2]) self.x.pop(0) self.x.append(x_next) return x_next class RowColumnEncryptor: def __init__(self): self.nchmd NCHMD() def row_encrypt(self, img): h,w img.shape out img.copy() for i in range(h): row_hash np.sum(out[i]) % 256 chaos_seq [self.nchmd.next() for _ in range(w)] # 根据哈希值偏移 shift row_hash % w out[i] np.roll(out[i], shift) # 扩散 for j in range(1,w): out[i,j] (out[i,j] out[i,j-1] int(chaos_seq[j]*255)) % 256 return out def col_encrypt(self, img): h,w img.shape out img.copy() for j in range(w): col_hash np.sum(out[:,j]) % 256 chaos_seq [self.nchmd.next() for _ in range(h)] shift col_hash % h out[:,j] np.roll(out[:,j], shift) for i in range(1,h): out[i,j] (out[i,j] out[i-1,j] int(chaos_seq[i]*255)) % 256 return out def encrypt(self, img): tmp self.row_encrypt(img) enc self.col_encrypt(tmp) return enc if __name__ __main__: test_img np.random.randint(0,256, (256,256), dtypenp.uint8) enc_lchm ImageEncryptor(methodLCHM) encrypted enc_lchm.encrypt(test_img) print(fLCHM加密完成第一行前5个像素: {encrypted[0,:5]}) rc_enc RowColumnEncryptor() enc2 rc_enc.encrypt(test_img) print(f行列加密完成第一行前5个: {enc2[0,:5]})