- STW Clever types – random code generator – anyone??
Does any of you guys know of a system/app/program that could randomly generate a code that could then be cross referenced back to an ‘original’ code?
random code generated would then when searched by us would reveal the original true code??
Hope this makes sensePosted 3 days agoDaffySubscriber
You could do this in Python in <30 mins.
Tabulate your original codes in Excel and save as a CSV, Start Python, Import Numpy read the CSV into Python as an array, write a statement which reads the array and when a value without a corresponding value (next column) is found, it triggers the random number generator within a range of values and assigns those values to the array. Write the file back.Posted 2 days agotomparkinMember
I think it depends on how the recovery of the original code would need to work.
I think there are two approaches:
1. Original code and random code are somehow cross-referenced in a database or similar. If this is acceptable, any pseudorandom number generator would do, so long as you ensure you avoid clashes in the database.
2. Original code is algorithmically derived from the random code. You could do that with some kind of reversible/symmetric function. It could be a crypo function as Cougar says.
If you want the mapping of original code to random code to be secure to some degree, you will need to consider this carefully in your approach.Posted 2 days agorjmccann101Subscriber
Without knowing about you particular use case, what are these codes used for, it’s hard to give a definitive answer. You could look at one way hashing, the openssl library is available on most platforms and provides sha3 secure one way hashes.
If a raw hash is too much data you could use an agreed subset of the hash, say you want a 6 character code take characters 1,2,3,5,8,13 say each time. This does increase the risk of collision, two values giving the same code.
The advantage of this approach is that you don’t have to store the codes, they can always be regenerated.
But a lot of this depends on volumes and what your planning to actually do!Posted 2 days agoscuttlerMember
Requirement sounds more like a tokenisation requirement than encryption.Posted 1 minute ago
You must be logged in to reply to this topic.