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

1

0

I'm wanting to encrypt 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

Hanley answered 23/6, 2011 at 0:55 Comment(1)
I found an article ([codeproject.com/KB/security/ComboEncryption.aspx]) that I think will prove useful for the combining of the two encryption methods. However, I still wonder whether this will all fit in a QR code.Hanley
E
1

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.

Embowed answered 23/6, 2011 at 8:27 Comment(1)
Sounds like this is going to be the showbreaker of the project, so I'd better get a demo of just this portion of the code running to see if it'll work. While I'm comparing alternative barcodes, such as the Aztec Code, generally how many bytes should I set aside for the encrypted Rjindael key, assuming AES-256? Thanks for your help!Hanley

© 2022 - 2024 — McMap. All rights reserved.