pyope
pyope copied to clipboard
How to control the range of the ciphertext
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?
We encountered this problem before, but it is solved now. Are you use lastest version of the code?
@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).