Skip to content

Generate same cypher for any length string #9

@junejosheeraz

Description

@junejosheeraz

Prerequisites

Description

I have successfully used the library to Encrypt and Decrypt values. See below;

Raw Value=1234567890123456, Encrypted=5959499404198841, Decrypted=1234567890123456
Raw Value=MNEMONIC, Encrypted= XXZI9ob, Decrypted=MNEMONIC
Raw Value=SOMEVALU, Encrypted=TC6WQj21, Decrypted=SOMEVALU
Raw Value=SOM, Encrypted=qVI, Decrypted=SOM
Raw Value=SOME, Encrypted=mJry, Decrypted=SOME
Raw Value=SOMEV, Encrypted=j4b4f, Decrypted=SOMEV

As you can see my requirement is that user would be storing the encrypted values in thier database and they would want to search on these encrypted values using LIKE '%' but this won't work because it generates different value depending on the length of the string. Is there anyway I can restrict the library to generate the value to be as follows;

Raw Value=SOMEVALU, Encrypted=TC6WQj21, Decrypted=SOMEVALU
Raw Value=SOM, Encrypted=TC6, Decrypted=SOM
Raw Value=SOME, Encrypted=TC6W, Decrypted=SOME
Raw Value=SOMEV, Encrypted=TC6WQ, Decrypted=SOMEV

Or am I missing the whole point?

Versions

1.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions