highspeedlogic算法仿真--AES/DES
% Set 1 data
a{1,1} = 'Alice';
a{1,2} = 'alice123';
a{2,1} = 'Bob';
a{2,2} = 'Bob123';
a{1,3} = [1 1 0 0];
a{2,3} = [1 1 0 0 1 0];
a
%Convert to uint8 format and encrypt
[row col] = size(a);
for i=1:row
for j=1:col
if ~ischar(a{i,j})|~isa(a{i,j},'uint8')
uint8_a = uint8(a{i,j});
encry_op{i,j} = aescrypt(uint8_a,'test1234');
else
【highspeedlogic算法仿真--AES/DES】encry_op{i,j} = aescrypt(a{i,j},'test1234');
end
end
end
encry_op
% uint8_reshape_a = uint8(reshape_a)
%Decryption
[row col] = size(encry_op);
for i=1:row
for j=1:col
decry_op{i,j} = aesdecrypt(encry_op{i,j},'test1234');
end
end
decry_op
%Reconstruct
reconstruct_op = decry_op;
for i=1:row
for j=1:2
reconstruct_op{i,j}=char(decry_op{i,j});
end
end
reconstruct_op
推荐阅读
- 画解算法(1.|画解算法:1. 两数之和)
- Guava|Guava RateLimiter与限流算法
- 一个选择排序算法
- SG平滑轨迹算法的原理和实现
- 《算法》-图[有向图]
- LeetCode算法题-11.|LeetCode算法题-11. 盛最多水的容器(Swift)
- 虚拟DOM-Diff算法详解
- 《数据结构与算法之美》——队列
- 算法回顾(SVD在协同过滤推荐系统中的应用)
- 简谈迪克斯特拉算法