Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025

 


Article

4GL/ABL: The one way uniqueness of the Progress 4GL ENCODE function

« Go Back

Information

 
Article Number000001759
EnvironmentProduct: OpenEdge
Version 10.x, 11.x
Product: Progress
Version: 8.x, 9.x
OS: All supported platforms
Question/Problem Description
4GL/ABL: The one way uniqueness of the Progress 4GL ENCODE function

What does the Progress 4GL ENCODE function do?

Can the action of the Progress 4GL ENCODE function be reversed?

What algorithm is used by the Progress 4GL ENCODE function?
Steps to Reproduce
Clarifying Information
Error Message
Defect/Enhancement Number
Cause
Resolution
The Progress 4GL ENCODE Function takes a character string as input and returns a 16 character long encoded string.
 
Although the same source character string always yields a unique result the reverse is not true. That is the action of the Progress 4GL ENCODE function is not reversible and there is no 4GL function that would return the original source string by acting upon its encrypted value.
 
The Progress 4GL ENCODE function uses a CRC-16 algorithm to generate its encoded output. This calculation involves a mathematical computational process that applies a polynomial value on the string.

The ENCODE function works on the byte values of the character string. The same character string in a different codepage can have different byte values, so the result of ENCODE will be different in that case.
 
The Progress 4GL ENCODE function operates on strings containing single as well as double-byte characters; of any length subject to Progress 4GL variable size limitations; and performs a one-way encoding operation that is irreversible.

That is:
 
If cStringA = cStringB  then ENCODE(cStringA) = ENCODE(cStringB).
 
However:
 
If ENCODE(cStringA) = ENCODE(cStringB) then cStringA may or may not be equal to cStringB.
 
In other words it is not possible to determine the original string from the result returned by the Progress 4GL ENCODE function.
 
Workaround
Notes
Attachment 
Last Modified Date6/27/2019 1:17 PM