【Java精品源码栏目提醒】:网学会员,鉴于大家对Java精品源码十分关注,论文会员在此为大家搜集整理了“AES加密解密算法(Java版本) - 其它资料”一文,供大家参考学习!
实现功能: 已知明文为 0123456789ABCDEF 的 ASCII 码表示的 128 比特 密钥是 0101101100001110 的 12 次重复构成的 192 比特密钥 编写 AES 的加解密程序,对明文进行加密,并进行解密验证1.程序结构2.运行结果3.源代码 .AESclass 类:public class AESclass private byte sbox 99124119123-14107111-5948110343-2-41-85118 -54-126-55125-68971-16-83-44-94-81-100-92114-64 -73-3-109385463-9-5252-91-27-15113-404921 4-5735-6124-1065-102718-128-30-2139-78117 9-12544262711090-968259-42-7741-2947-124 83-470-1932-4-7991106-53-6657747688-49 -48-17-86-5677751-12369-721278060-97-88 81-9364-113-110-9956-11-68-74-383316-1-13-46 -511219-2095-1056823-60-89126611009325115 96-12779-363442-112-12070-18-7220-349411-37 -325058107363692-62-45-8498-111-107-28121 -25-5655109-115-4378-8710886-12-22101122-828 -70120374628-90-76-58-24-351163175-67-117-118 11262-75102723-1014975387-71-122-6329-98 -31-8-10417105-39-114-108-10130-121-23-508540-33 -116-95-11913-65-266610465-1034515-8084-6922 private byte rsbox 829106-434854-9156-6564-93-98-127-13-41-5 124-2957-126-10147-1-12152-1146768-60-34-23-53 84123-10850-90-623561-1876-1071166-6-6178 846-9510240-3936-7811891-9473109-117-4737 114-8-10100-122104-10422-44-9292-5293101-74-110 1081127280-3-19-71-3894217087-89-115-99-124 -112-40-850-116-68-4510-9-28885-72-77696 -484430-113-5463152-63-81-673119-118107 58-111176579103-36-22-105-14-49-50-16-76-26115 -106-8411634-25-8353-123-30-755-2428117-33110 71--59-119111-739814-8624-6627 -4866275-58-4612132-102-37-64-2120-5190-12 31-35-8851-1207-5749-7918168939-128-2095 9681127-8725-75741345-27122-97-109-55-100-17 -96-325977-8242-11-80-56-21-6960-12583-10397 23434126-70119-4238-311052099853312125private byte mut 2311 1231 1123 3112 private byte rmut 1411139 9141113 1391411 1113914private byte by124816 3264-1282754 108-40-8577-102 private intr0x000x010x020x040x080x100x200x400x800x1b0x360x170x15 byte allkeynew byte1344 byte enbytenew byte16 byte debytenew byte16 //字节替代, public byte subbytebyte sub byte rowcol byte tempnew byte44 forint i0i40xf tempijsboxrowcol return temp public byte subbytebyte subint r byte rowcol byte tempnew byte44 forint i0i40xf tempijrsboxrowcol return temp //行移位 public byte shiftbyte sub byte temp tempsub10 sub10sub11sub11sub12sub12sub13sub13temp tempsub20 sub20sub22sub22temp tempsub21 sub21sub23sub23temp tempsub30 sub30sub33sub33sub32sub32sub31sub31temp return sub public byte shiftbyte subint mode byte temp tempsub30 sub30sub31sub31sub32sub32sub33sub33temp tempsub20 sub20sub22sub22temp tempsub21 sub21sub23sub23temp tempsub10 sub10sub13sub13sub12sub12sub11sub11temp return sub//列混合public byte mixbyte sub byte count0 byte tempnew byte44 forint i0i上一篇:Java_EE开发环境的安装与熟悉