• 大小: 65.59MB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2022-01-12
  • 语言: Matlab
  • 标签: AES  DPA  Matlab  

资源简介

包含三个AES功耗攻击的Matlab脚本,采的曲线条数是5000条,一条曲线10000个点。

资源截图

代码片段和文件信息

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Matlab key recovery exercise template %
%                                       %
% 2014 Filip Stepanek and Jiri Bucek   %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% declaration of the SBOX (might be useful to calculate the power hypothesis)
SBOX=[099 124 119 123 242 107 111 197 048 001 103 043 254 215 171 118 ...
      202 130 201 125 250 089 071 240 173 212 162 175 156 164 114 192 ...
      183 253 147 038 054 063 247 204 052 165 229 241 113 216 049 021 ...
      004 199 035 195 024 150 005 154 007 018 128 226 235 039 178 117 ...
      009 131 044 026 027 110 090 160 082 059 214 179 041 227 047 132 ...
      083 209 000 237 032 252 177 091 106 203 190 057 074 076 088 207 ...
      208 239 170 251 067 077 051 133 069 249 002 127 080 060 159 168 ...
      081 163 064 143 146 157 056 245 188 182 218 033 016 255 243 210 ...
      205 012 019 236 095 151 068 023 196 167 126 061 100 093 025 115 ...
      096 129 079 220 034 042 144 136 070 238 184 020 222 094 011 219 ...
      224 050 058 010 073 006 036 092 194 211 172 098 145 149 228 121 ...
      231 200 055 109 141 213 078 169 108 086 244 234 101 122 174 008 ...
      186 120 037 046 028 166 180 198 232 221 116 031 075 189 139 138 ...
      112 062 181 102 072 003 246 014 097 053 087 185 134 193 029 158 ...
      225 248 152 017 105 217 142 148 155 030 135 233 206 085 040 223 ...
      140 161 137 013 191 230 066 104 065 153 045 015 176 084 187 022];


%%%%%%%%%%%%%%%%%%%%
% LOADING the DATA %
%%%%%%%%%%%%%%%%%%%%

% modify following variables so they correspond 
% your measurement setup
numberOfTraces = 200;
traceSize = 350000;

% modify the following variables to speed-up the measurement
% (this can be done later after analysing the power trace)
offset = 0;
segmentLength = 350000; % for the beginning the segmentLength = traceSize
                    
% columns and rows variables are used as inputs 
% to the function loading the plaintext/ciphertext
columns = 16;
rows = numberOfTraces;

%%%%%%%%%%%%%%%%%%%%%%%%%
% Calling the functions %
%%%%%%%%%%%%%%%%%%%%%%%%%

% function myload processes the binary file containing the measured traces and
% stores the data in the output matrix so the traces (or their reduced parts)
% can be used for the key recovery process.
% Inputs:
%   ‘file‘ - name of the file containing the measured traces
%   traceSize - number of samples in each trace
%   offset - used to define different beginning of the power trace
%   segmentLength - used to define different/reduced length of the power trace
%   numberOfTraces - number of traces to be loaded
%
% To reduce the size of the trace (e.g. to speed-up the computation process) 
% modify the offset and segmentLength inputs so the loaded parts of the
% traces correspond to the trace segment you are using for the recovery.
traces = myload(‘traces.bin‘ traceSize offset segmentLength numberOfTraces);

% function myi

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      10002  2016-03-03 21:40  Analysis\ciphertext-00112233445566778899aabbccddeeff.txt

     文件       7500  2014-07-04 17:01  Analysis\ciphertext-unknown_key.txt

     文件     501582  2016-03-03 21:38  Analysis\dpa_Lisbon.pdf

     文件       5101  2014-07-07 12:55  Analysis\measurement.m

     文件        650  2013-02-19 15:18  Analysis\mycorr.m

     文件        192  2013-02-18 14:54  Analysis\myin.m

     文件        347  2013-02-19 12:56  Analysis\myload.m

     文件      10002  2016-03-03 21:40  Analysis\plaintext-00112233445566778899aabbccddeeff.txt

     文件       7500  2014-07-04 17:01  Analysis\plaintext-unknown_key.txt

     文件        565  2016-03-03 21:43  Analysis\tab.mat

     文件          9  2014-07-04 17:01  Analysis\traceLength-unknown_key.txt

     文件   74000000  2016-03-03 21:41  Analysis\traces-00112233445566778899aabbccddeeff.bin

     文件   82500000  2014-07-04 17:01  Analysis\traces-unknown_key.bin

    ..AD...         0  2016-03-06 18:25  Analysis

----------- ---------  ---------- -----  ----

            157043450                    14


评论

共有 条评论