2

Scenario: Have to generate qr code which contains some customer information. It will be scanned in android phone.

The information have to transfer in following process.

----------------------Server side---------|| Image ||------Android-----------------------------

original data-->Encrypt--->> Compress---> ||Qr code|| --> Decompress-->>Decrypt-->original data

Everything goes well. But Text compression is not efficient.

Is any efficient way to do this?

John
  • 45
  • 1
  • 6
Amir
  • 1,066
  • 1
  • 13
  • 26
  • 4
    It's not surprising that compressing "random" data like the output of a good block cipher is not efficient. Maybe compress *before* encryption? – Niklas B. Nov 03 '14 at 12:47

1 Answers1

1

Without having tried it, I would say that Run-Length Encoding (RLE) (http://en.wikipedia.org/wiki/Run-length_encoding) would be a nice candidate. The main idea is that you can replace a run of identical symbols with it's length. So, if you have the 0 and 1 symbols for the pixels (dunno, if they are called like that on a QRcode), then one line of the qr code which would resemble something like this: 000000000000111111011111111111111110000000001 would be compressed to this: 12,6,1,16,9,1

Cantfindname
  • 2,008
  • 1
  • 17
  • 30