%the main job of this function mutlply each give column with matrix
% X= [ 2 3 1 1
% 1 2 3 1
% 1 1 2 3
% 3 2 1 1 ];
function S = Invmixcolumns ( D )
%D=[4,224, 72,40
% 102, 203 ,248,6
% 129, 25 ,211,38
% 229,154,122,76
%];
Multip_9 =[
0 9 18 27 36 45 54 63 72 65 90 83 108 101 126 119 144 153 130 139 180 189 166 175 216 209 202 195 252 245 238 231 59 50 41 32 31 22 13 4 115 122 97 104 87 94 69 76 171 162 185 176 143 134 157 148 227 234 241 248 199 206 213 220 118 127 100 109 82 91 64 73 62 55 44 37 26 19 8 1 230 239 244 253 194 203 208 217 174 167 188 181 138 131 152 145 77 68 95 86 105 96 123 114 5 12 23 30 33 40 51 58 221 212 207 198 249 240 235 226 149 156 135 142 177 184 163 170 236 229 254 247 200 193 218 211 164 173 182 191 128 137 146 155 124 117 110 103 88 81 74 67 52 61 38 47 16 25 2 11 215 222 197 204 243 250 225 232 159 150 141 132 187 178 169 160 71 78 85 92 99 106 113 120 15 6 29 20 43 34 57 48 154 147 136 129 190 183 172 165 210 219 192 201 246 255 228 237 10 3 24 17 46 39 60 53 66 75 80 89 102 111 116 125 161 168 179 186 133 140 151 158 233 224 251 242 205 196 223 214 49 56 35 42 21 28 7 14 121 112 107 98 93 84 79 70
];
Multip_11=[
0 11 22 29 44 39 58 49 88 83 78 69 116 127 98 105 176 187 166 173 156 151 138 129 232 227 254 245 196 207 210 217 123 112 109 102 87 92 65 74 35 40 53 62 15 4 25 18 203 192 221 214 231 236 241 250 147 152 133 142 191 180 169 162 246 253 224 235 218 209 204 199 174 165 184 179 130 137 148 159 70 77 80 91 106 97 124 119 30 21 8 3 50 57 36 47 141 134 155 144 161 170 183 188 213 222 195 200 249 242 239 228 61 54 43 32 17 26 7 12 101 110 115 120 73 66 95 84 247 252 225 234 219 208 205 198 175 164 185 178 131 136 149 158 71 76 81 90 107 96 125 118 31 20 9 2 51 56 37 46 140 135 154 145 160 171 182 189 212 223 194 201 248 243 238 229 60 55 42 33 16 27 6 13 100 111 114 121 72 67 94 85 1 10 23 28 45 38 59 48 89 82 79 68 117 126 99 104 177 186 167 172 157 150 139 128 233 226 255 244 197 206 211 216 122 113 108 103 86 93 64 75 34 41 52 63 14 5 24 19 202 193 220 215 230 237 240 251 146 153 132 143 190 181 168 163
];
Multip_13=[
0 13 26 23 52 57 46 35 104 101 114 127 92 81 70 75 208 221 202 199 228 233 254 243 184 181 162 175 140 129 150 155 187 182 161 172 143 130 149 152 211 222 201 196 231 234 253 240 107 102 113 124 95 82 69 72 3 14 25 20 55 58 45 32 109 96 119 122 89 84 67 78 5 8 31 18 49 60 43 38 189 176 167 170 137 132 147 158 213 216 207 194 225 236 251 246 214 219 204 193 226 239 248 245 190 179 164 169 138 135 144 157 6 11 28 17 50 63 40 37 110 99 116 121 90 87 64 77 218 215 192 205 238 227 244 249 178 191 168 165 134 139 156 145 10 7 16 29 62 51 36 41 98 111 120 117 86 91 76 65 97 108 123 118 85 88 79 66 9 4 19 30 61 48 39 42 177 188 171 166 133 136 159 146 217 212 195 206 237 224 247 250 183 186 173 160 131 142 153 148 223 210 197 200 235 230 241 252 103 106 125 112 83 94 73 68 15 2 21 24 59 54 33 44 12 1 22 27 56 53 34 47 100 105 126 115 80 93 74 71 220 209 198 203 232 229 242 255 180 185 174 163 128 141 154 151
];
Multip_14=[
0 14 28 18 56 54 36 42 112 126 108 98 72 70 84 90 224 238 252 242 216 214 196 202 144 158 140 130 168 166 180 186 219 213 199 201 227 237 255 241 171 165 183 185 147 157 143 129 59 53 39 41 3 13 31 17 75 69 87 89 115 125 111 97 173 163 177 191 149 155 137 135 221 211 193 207 229 235 249 247 77 67 81 95 117 123 105 103 61 51 33 47 5 11 25 23 118 120 106 100 78 64 82 92 6 8 26 20 62 48 34 44 150 152 138 132 174 160 178 188 230 232 250 244 222 208 194 204 65 79 93 83 121 119 101 107 49 63 45 35 9 7 21 27 161 175 189 179 153 151 133 139 209 223 205 195 233 231 245 251 154 148 134 136 162 172 190 176 234 228 246 248 210 220 206 192 122 116 102 104 66 76 94 80 10 4 22 24 50 60 46 32 236 226 240 254 212 218 200 198 156 146 128 142 164 170 184 182 12 2 16 30 52 58 40 38 124 114 96 110 68 74 88 86 55 57 43 37 15 1 19 29 71 73 91 85 127 113 99 109 215 217 203 197 239 225 243 253 167 169 187 181 159 145 131 141
];
%mutliply colum 1 from D 4x4 ciphered matrix
%mutipl by row 1
temp=bitxor(Multip_14(D(1,1)+1),Multip_11(D(2,1)+1));
temp=bitxor(temp,Multip_13(D(3,1)+1));
S(1,1)=bitxor(temp,Multip_9(D(4,1)+1));
%mutipl by row 2
temp=bitxor(Multip_9(D(1,1)+1),Multip_14(D(2,1)+1));
temp=bitxor(temp,Multip_11(D(3,1)+1));
S(2,1)=bitxor(temp,Multip_13(D(4,1)+1));
%mutipl by row 3
temp=bitxor(Multip_13(D(1,1)+1),Multip_9(D(2,1)+1));
temp=bitxor(temp,Multip_14(D(3,1)+1));
S(3,1)=bitxor(temp,Multip_11(D(4,1)+1));
%mutipl by row 4
temp=bitxor(Multip_11(D(1,1)+1),Multip_13(D(2,1)+1));
temp=bitxor(temp,Multip_9(D(3,1)+1));
S(4,1)=bitxor(temp,Multip_14(D(4,1)+1));
%mutliply colum 2 from D 4x4 ciphered matrix
%mutipl by row 1
temp=bitxor(Multip_14(D(1,2)+1),Multip_11(D(2,2)+1));
temp=bitxor(temp,Multip_13(D(3,2)+1));
S(1,2)=bitxor(temp,Multip_9(D(4,2)+1));
%mutipl by row 2
temp=bitxor(Multip_9(D(1,2)+1),Multip_14(D(2,2)+1));
temp=bitxor(temp,Multip_11(D(3,2)+1));
S(2,2)=bitxor(temp,Multip_13(D(4,2)+1));
%mutipl by row 3
temp=bitxor(Multip_13(D(1,2)+1),Multip_9(D(2,2)+1));
temp=bitxor(temp,Multip_14(D(3,2)+1));
S(3,2)=bitxor(temp,Multip_11(D(4,2)+1));
%mutipl by row 4
temp=bitxor(Multip_11(D(1,2)+1),Multip_13(D(2,2)+1));
temp=bitxor(temp,Multip_9(D(3,2)+1));
S(4,2)=bitxor(temp,Multip_14(D(4,2)+1));
%mutliply colum 3 from D 4x4 ciphered matrix
%mutipl by row 1
temp=bitxor(Multip_14(D(1,3)+1),Multip_11(D(2,3)+1));
temp=bitxor(temp,Multip_13(D(3,3)+1));
S(1,3)=bitxor(temp,Multip_9(D(4,3)+1));
%mutipl by row 2
temp=bitxor(Multip_9(D(1,3)+1),Multip_14(D(2,3)+1));
temp=bitxor(temp,Multip_11(D(3,3)+1));
S(2,3)=bitxor(temp,Multip_13(D(4,3)+1));
%mutipl by row 3
temp=bitxor(Multip_13(D(1,3)+1),Multip_9(D(2,3)+1));
temp=bitxor(temp,Multip_14(D(3,3)+1));
S(3,3)=bitxor(temp,Multip_11(D(4,3)+1));
%mutipl by row 4
temp=bitxor(Multip_11(D(1,3)+1),Multip_13(D(2,3)+1));
temp=bitxor(temp,Multip_9(D(3,3)+1));
S(4,3)=bitxor(temp,Multip_14(D(4,3)+1));
%mutliply colum 4 from D 4x4 ciphered matrix
%mutipl by row 1
temp=bitxor(Multip_14(D(1,4)+1),Multip_11(D(2,4)+1));
temp=bitxor(temp,Multip_13(D(3,4)+1));
S(1,4)=bitxor(temp,Multip_9(D(4,4)+1));
%mutipl by row 2
temp=bitxor(Multip_9(D(1,4)+1),Multip_14(D(2,4)+1));
temp=bitxor(temp,Multip_11(D(3,4)+1));
S(2,4)=bitxor(temp,Multip_13(D(4,4)+1));
%mutipl by row 3
temp=bitxor(Multip_13(D(1,4)+1),Multip_9(D(2,4)+1));
temp=bitxor(temp,Multip_14(D(3,4)+1));
S(3,4)=bitxor(temp,Multip_11(D(4,4)+1));
%mutipl by row 4
temp=bitxor(Multip_11(D(1,4)+1),Multip_13(D(2,4)+1));
temp=bitxor(temp,Multip_9(D(3,4)+1));
S(4,4)=bitxor(temp,Multip_14(D(4,4)+1));
%disp(S);
AES.rar_AES_aes matlab_by6695.com_matlab AES
版权申诉
67 浏览量
2022-09-19
20:43:54
上传
评论
收藏 231KB RAR 举报
四散
- 粉丝: 54
- 资源: 1万+
最新资源
- 电气创新项目实训大作业要求及评分标准
- elasticsearch-analysis-dynamic-synonym-7.0.0编译后的插件
- matlab课程时间安排题目
- 111111111111111
- 笔记Typora语法应用
- elasticsearch-analysis-dynamic-synonym-7.0.0源码下载
- 2024年l兰州文理学院大学生数学建模竞赛校级选拔赛题目 (1)
- SSM3J305T-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- 信息安全,SM3算法,哈希算法
- Java项目-基于Springboot+Vue的论坛管理系统的设计与实现(源码+万字LW+部署视频+代码讲解视频+全套软件 )
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈