开发者

Using Rjindael and RSA to encrypt data stored in QR code in Visual Basic .NET

开发者 https://www.devze.com 2023-03-14 15:58 出处:网络
I\'m wanting to e开发者_开发知识库ncrypt some data (hopefully under five hundred bytes\' worth) and store it in a QR code. Originally I wanted to use RSA, so the data would be signed with User A\'s pr

I'm wanting to e开发者_开发知识库ncrypt some data (hopefully under five hundred bytes' worth) and store it in a QR code. Originally I wanted to use RSA, so the data would be signed with User A's private key and User B's public key, but unfortunately, VB.NET doesn't like encrypting that much data. I've read that I should use Rjindael to encrypt the actual data, and then use RSA to encrypt the key used by Rjindael. However, I'm not having much luck being able to search the web for some kind of tutorial or something.

Also, if I was wanting to store this on a QR code, wouldn't I have to store both the encrypted data and the encrypted key used by Rjindael? Do you think this would all fit? I may be able to use version 40 on medium error correction (according to http://www.denso-wave.com/qrcode/vertable4-e.html, it stores 18,672 "data bits"), but I would prefer to use a lower version (that is, smaller) if at all possible.

Generating the QR code won't be the problem (I know there's a .NET library for that), I'm just curious about getting the data encrypted to begin with.

Thanks for your help!

Sam


Look at the "binary" column. This is actually how many bytes you can store. Anything above version 10 gets a bit hard to scan in practice, though possible. Above version 20 it's quite difficult from a camera, though can be scanned off a printed page. So if the point is to scan with a camera -- no doesn't sound like it will fit in practice.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号