我想使用Tripledescryptoserviceprovider和MD5CryptoServiceProvider的哈希值将128位转换为168位密钥 [英] I want to convert 128bits to 168 bits key using tripledescryptoserviceprovider and MD5CryptoServiceProvider for hash values

查看:168
本文介绍了我想使用Tripledescryptoserviceprovider和MD5CryptoServiceProvider的哈希值将128位转换为168位密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当前正在使用"tripledescryptoserviceprovider"进行加密,并使用 MD5CryptoServiceProvider 进行哈希值处理.我想将128位转换为168位密钥.请说明我该怎么做.

谢谢.

Hi,

Currently am using "tripledescryptoserviceprovider" for encryption and MD5CryptoServiceProvider for hash values. I want to convert 128bits to 168 bits key. Please explain how can I do this.

Thanks.

推荐答案

此请求很乱.获取键应该是没有后门单向功能.为什么?好吧,出于明显的安全原因. :-)不仅转换"是不可行的,也没有任何意义.您只能创建一个新的密钥或不同大小的密钥对.请参阅:
http://en.wikipedia.org/wiki/One-way_function [ http://en.wikipedia.org/wiki/Backdoor_%28computing%29 [ ^ ].

也许,您真的要问如何使用168位密钥?",而没有任何转换".如果是这样,您应该清楚地表达自己.顺便说一句,为什么这么奇怪的密钥大小?老实说,很久以来我都没有听说过小于1K大小的密钥.和其他尺寸通常是1K的倍数.

无论如何,请阅读以下内容:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.symmetricalgorithm.keysize.aspx [ ^ ].

请注意例外CryptographicException密钥大小无效".您的密钥大小不能为任意数字.

—SA
This request is gibberish. Obtaining a key is supposed to be a one-way function without a backdoor. Why? Well, for apparent security reasons. :-) Not just the "convert" is infeasible, it makes no any sense. You can only create a new key or key pair of different size. Please see:
http://en.wikipedia.org/wiki/One-way_function[^],
http://en.wikipedia.org/wiki/Backdoor_%28computing%29[^].

Perhaps, you really meant to ask "how to use 168 bit key?", without any "conversion". If so, you should have express yourself clearly. By the way, why such weird key size? Honestly, I did not hear about keys less then 1K size for ages; and other sized are usually multiples of 1K.

Anyway, read this:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.symmetricalgorithm.keysize.aspx[^].

Pay attention for the exception CryptographicException "The key size is not valid". Your key size cannot be any arbitrary number.

—SA


这篇关于我想使用Tripledescryptoserviceprovider和MD5CryptoServiceProvider的哈希值将128位转换为168位密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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