matlab - 如果 128 位长度超过 16 个字符,如何加密 AES?
问题描述
以下是 Matlab 中的代码片段,如果长度小于 16,则填充零:
function plaintext_zeros = zerofill(plaintext)
if(length(plaintext) >= 1 && length(plaintext) < 16)
for i = length(plaintext)+1:16
plaintext(i) = 0;
end
elseif(length(plaintext) > 16)
error('Input plaintext has to be between 1 and 16 characters.');
elseif(isempty(plaintext))
error('No input plaintext given');
end
plaintext_zeros = plaintext;
end
解决方案
推荐阅读
- security - 了解在哪里生成 fullchain.pem 和 privkey.pem 适合此集群设置
- javascript - findByIdAndUpdate 在使用 $set 时更新错误的子对象
- dictionary - 映射到数组内对象内的数组
- javascript - 如何使用 jquery 每个函数为元素添加宽度?
- report - 谷歌数据工作室未能提供“搜索关键字与首页排名”的表格
- javascript - XMLHttpRequest 未定义
- python - 如何根据列表在 kivy 中生成 6 个彩色标签?
- php - 查询计算每个月的总工资
- ios - 调用 tableView.reloadData() 时 UITableView 不更新,是什么导致了这个问题?
- php - 执行后台外部程序