使用C#和解密AES加密在Java中 [英] AES encryption using C# and decryption in Java

查看:1072
本文介绍了使用C#和解密AES加密在Java中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想确认一下我的AES是如何工作的理解。

I just want to confirm my understanding of how AES works.

如果公司#1加密数据,并将这些数据发送给公司#2解密,让我们假定其中的一个使用C#和其他Java。

If company#1 is encrypting the data, and sending this data to company#2 to decrypt, and let's presume that one of them uses C# and the other Java.

只要两者都使用相同的共享密钥,还有什么设置/配置明智两个各方应商定,以确保数据是正确的加密和解密?

As long as both are using the same shared secret key, is there anything else setting/configuration wise both parties should agree upon to make sure the data is correctly encryption and decrypted?

推荐答案

有很多在都具有在同意


  • 共享密钥


    • 是多久? (是否需要填充的关键?)

    • 是从另一个密钥或密码有一个额外的盐而得的实际钥匙?


      • 使用哪个密钥推导函数和他们有什么参数? PBKDF2,bcrypt,scrypt,...

      • 是IV与密钥一起导出? (通常是通过请求密钥大小+ IV尺寸输出密钥导出函数)


      • 块加密AES一样,三重DES,Twofish的,Rijndael算法,...


        • 密码参数,如块大小的情况下,它是变


        • 为基于IV模式:四是如何产生的?是它产生的随机放入容器格式或者是它与来自一个密码密钥一起产生的,因此并不需要被放入密文容器?

        • 用于基于随机数像CTR模式:到底有多大是参数化模式,如CFB随机数(有时被称为IV)

        • :如何大是段


        • 填充模式像的PKCS#7填充(其也被称为PKCS#5填充),ZeroPadding,...

        • for IV-based modes: How is the IV generated? Is it generated randomly and put into the container format or is it derived together with the key from a password and therefore doesn't need to be put into the ciphertext container?
        • for nonce-based modes like CTR: How big is the nonce (sometimes referred to as IV)?
        • for parametrized modes like CFB: How big is a segment?

        • 像GCM,EAX,SIV,运作模式...

        • 作为与MAC像HMAC-SHA256,CMAC,香港民主促进会,GHASH,...
          $ b每个部件的编码$ b
        • 一切都一起被编码到从成品二进制格式文本格式或者组件单独编码,并连接到一起?

        • Is everything encoded together into a textual format from the finished binary format or are the components encoded separately and concatenated together?

        • 如果把IV /当前时间/盐(如果有的话)? (通常是实际的密文之前)

        • 如果把认证标签(如果有的话)? (通常在实际的密文)

        • 加密消息语法适用?

        • Where to put IV/nonce/salt (if any)? (usually before the actual ciphertext)
        • Where to put authentication tag (if any)? (usually after the actual ciphertext)
        • Is Cryptographic Message Syntax applicable?

        这篇关于使用C#和解密AES加密在Java中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆