当前位置: 首页 > news >正文

myeclipse做web网站重庆seo技术

myeclipse做web网站,重庆seo技术,黑彩网站建设需要什么东西,wordpress没有关键字1. 引言 前序博客: ASCON:以“慢而稳”赢得NIST轻量级加密算法标准密码学中的AEAD(authenticated encryption with associated data) 对称密钥加密过去数年来已发生改变,具体为: 当今主要使用stream ciphers,因其比…

1. 引言

前序博客:

  • ASCON:以“慢而稳”赢得NIST轻量级加密算法标准
  • 密码学中的AEAD(authenticated encryption with associated data)

对称密钥加密过去数年来已发生改变,具体为:

  • 当今主要使用stream ciphers,因其比block ciphers要快得多。
  • 经常会使用AEAD(Authenticated Encryption with Additional Data)。
  • 在加密过程中常使用sponge函数,进而支持使用sponge函数来创建对称密钥和哈希函数。
  • Rust现在正在成为一种事实上的软件语言,它在编码方面提高了健壮性。

ASCON代码示例见:

  • ASCON AEAD - Light-weight cipher
  • https://github.com/usnistgov/Lightweight-Cryptography-Benchmarking(C)
  • https://github.com/meichlseder/pyascon/blob/master/ascon.py(Python)
  • https://github.com/itzmeanjan/ascon(C++)
  • https://github.com/NomanNasirMinhas/ASCON_Benchmark(Rust)
  • https://github.com/sebastinas/isap-aead(Rust)
  • https://github.com/neoilir/Simple-ascon-hash-implementation-rust(Rust)
  • https://github.com/sebastinas/ascon-aead(Rust)
  • https://github.com/IAIK/ascon_hardware(VHDL,硬件实现)
  • https://github.com/ascon/ascon-c(C和汇编)
  • https://github.com/ascon/ascon-hardware(Python和VHDL,硬件实现)
  • https://github.com/RustCrypto/sponges/tree/master/ascon(Rust)
  • https://github.com/RustCrypto/AEADs/tree/master/ascon-aead(Rust)

2. AEAD(Authenticated Encryption with Additional Data)

所谓对称密钥加密,是指使用相同的密钥来加解密:
在这里插入图片描述
但是这样的对称密钥加密存在重放攻击问题,如:

  • Bob用对称密钥加密了一条消息给Alice,Alice收到密文用相同的对称密钥解密后,获得“你明天可休假一天”,于是Alice第二天休假了。
  • 但是,Eve窃听了上述消息,在第二天将相同的密文再次发送给Alice,Alice解密后,第三天又休假了一天。
  • Bob会很奇怪,为啥Alice连休了2天假。

原因就在于Eve对密文进行了重放攻击。因此,需要将加密过程与某网络连接或session绑定,使得Eve无法重构相同的场景。

通过增强的加密方法,使得既可认证加密,也可证明其完整性。这被称为关联数据的身份验证加密(AEAD)。为此,提供额外的数据来认证加密过程,并可识别密文已被修改因其无法被加密:
在这里插入图片描述
大多数传统的AEA方法为创建一个nonce值,并添加认证但不加密的额外数据(Additional Data, AD)。额外数据AD可为:

addresses, ports, sequence numbers, protocol version numbers, and other fields that indicate how the plaintext or ciphertext should be handled, forwarded, or processed

这样就可将网络包与加密数据绑定,提供了完整性,使得入侵者无法复制粘贴其它通道的密文来形成攻击。如,若绑定包序号和端口号,使用另一序号或端口号将认证失败。

可以用于AEAD的主要方法是AES GCM、AES SIV、AES CCM、ChaCha20/Poly1305和AES OCB3。每一个都是流密码,避免了CBC和ECB的块方法模式。

3. 基于ASCON的AEAD

如以https://github.com/RustCrypto/sponges/tree/master/ascon(Rust)实现的AEAD为例:

cargo new arc

相应的cargo.toml文件为:

[package]
name = "arc"
version = "0.1.0"
edition = "2021"# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html[dependencies]
ascon = "0.1.4"
rand="0.8.3"
hex="0.4.3"

相应的main.rs源代码为:

use ascon;
use rand::thread_rng;
use rand::Rng;
use hex::{self};
use std::env;fn get_random_key16() ->  [u8; 16]{let mut arr = [0u8; 16];thread_rng().try_fill(&mut arr[..]).expect("Ooops!");return arr;
}fn main() {let mut msg="hello";let mut aad1="test";let args: Vec<String> = env::args().collect();if args.len() >1 { msg = args[1].as_str();}if args.len() >2 { aad1 = args[2].as_str();}let randkey128=get_random_key16(); //为128字节let iv=get_random_key16(); //用作saltlet plaintext=msg.as_bytes();let aad=aad1.as_bytes();let (ciphertext,tag) = ascon::aead_encrypt(&randkey128, &iv, plaintext, aad); //tag也为128字节let pt=ascon::aead_decrypt(&randkey128, &iv,&ciphertext[..], &aad, &tag);let s = String::from_utf8(pt.unwrap()).expect("Found invalid UTF-8");println!("Message:\t{}\n",msg);println!("AAD:\t\t{}\n",aad1);println!("Key:\t\t{}\n",hex::encode(randkey128));println!("Cipher:\t\t{}\n",hex::encode(ciphertext));println!("Tag:\t\t{}\n",hex::encode(tag));println!("Decryped:\t{}", s);
}

运行结果为:

Message:        helloAAD:            testKey:            6680811197f36de07227b8f08ae31c33Cipher:         01e0d0d020Tag:            6e90b3a9790c28188172d5bd8041555dDecryped:       hello

参考资料

[1] Prof Bill Buchanan OBE 2023年9月博客 ASCON, Rust and AEAD: Is ASCON better than AES?

http://www.hkea.cn/news/967252/

相关文章:

  • 一般网站用什么做的最新新闻国内大事件
  • 做线上网站需要钱吗互联网营销推广
  • 找个美工做淘宝网站需要多少钱南昌seo方案
  • 网站用户登录流程图外贸高端网站设计公司
  • 做搜狗手机网站优化软代写
  • wordpress页面背景颜色win7优化设置
  • 做分类信息网站代码百度搜索推广优化师工作内容
  • 南京网站开发公司关键词推广
  • 合水口网站建设百度指数明星人气榜
  • 上传网站图片处理推广软件免费
  • 做网站怎么写代码下载百度软件
  • 县城做网站网站搭建关键词排名
  • b2b多平台一键发布seo需要掌握哪些技术
  • 网站建设推广合同网络广告联盟
  • 汽车网站正在建设中模板什么是营销模式
  • 宜昌seo百度seo优化
  • 做网站公司q房网seo快速排名站外流量推广
  • 南宁网站排名优化广州发布紧急通知
  • 网站建设的策划方案seo排名
  • 网站模板绑定域名培训班
  • coupang入驻条件2022台州关键词优化报价
  • 网站建设前景怎么样google优化师
  • 上海免费网站建设淘宝引流推广怎么做
  • 单位网站建设目的西安网站建设公司排行榜
  • 福州制作网站软件无人在线观看高清视频单曲直播
  • 建设银行卡网站百度账号登录个人中心
  • 网站显示500错误怎么解决方法seo网站推广排名
  • 广告免费设计在线生成网站排名优化
  • 余姚公司网站建设怎么建网址
  • 网站域名授权怎么做市场营销案例100例