pyope icon indicating copy to clipboard operation
pyope copied to clipboard

How to control the range of the ciphertext

Open asanshannon opened this issue 6 years ago • 2 comments

cipher1 = OPE(b'lg' * 2, in_range=ValueRange(0, 256),out_range=ValueRange(0, 9999))(does not work) assert in_size <= out_size AssertionError

If I want to encrypt 0~255, what is the minimum range of cipher text? Can the range of the ciphertext be debugged in the code?

asanshannon avatar Apr 25 '18 01:04 asanshannon

We encountered this problem before, but it is solved now. Are you use lastest version of the code?

hwfhc avatar Apr 27 '18 08:04 hwfhc

@asanshannon Please try to use the latest version of the package (0.2.1).

If I want to encrypt 0~255, what is the minimum range of cipher text?

The size of the output range should be at least as big as the input range, and by size I mean the total number of integers in that range. For example, ValueRange(0, 256) input can be mapped to ValueRange(100, 356) (both ranges contain have 257 numbers), but not to ValueRange(100, 355) (the output range is of size 256 here).

tonyo avatar May 05 '18 10:05 tonyo