Viewing 17 posts - 1 through 17 (of 17 total)
  • STW Clever types – random code generator – anyone??
  • Premier Icon geordiemick00
    Free Member

    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?

    example:

    true code
    ADXWW/120/XX/DD

    random code generated would then when searched by us would reveal the original true code??

    Hope this makes sense

    Premier Icon perchypanther
    Free Member

    Is this for you or your brother in-law?

    Premier Icon Drac
    Full Member

    Paging Chewkw.

    Premier Icon Daffy
    Full Member

    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.

    Premier Icon sam_underhill
    Full Member

    If it doesn’t need to be in the same format you could just use a GUID generator and store that alongside your real data.

    Premier Icon Cougar
    Full Member

    Does it need to be secure? Ie, do you want it so only you can reverse it to get the original?

    If so you’ve basically just described encryption.

    Premier Icon IHN
    Full Member

    BEYXX/231/YY/EE

    You’re welcome

    Premier Icon Kellies heros
    Free Member

    Substitution. You have missed the random requirement.

    Premier Icon tomparkin
    Free Member

    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.

    Premier Icon Cougar
    Full Member

    Actually, I’m slipping in my old age.

    You’be provided us with a solution and asked about how to implement it. This rather begs the question, what problem is this solution intended to solve?

    Premier Icon slackalice
    Full Member

    Actually, I’m slipping in my old age.

    You can get pads for that. With or without wings.
    HTH

    Premier Icon mrsheen
    Free Member

    Could VB Excel do this? Generates random set of characters generated and vlookup or search or similar to find the true code?

    Premier Icon GlennQuagmire
    Free Member

    You want two-way encryption using a cypher key of your choice.

    https://codebeautify.org/encrypt-decrypt

    Premier Icon rjmccann101
    Full Member

    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!

    Premier Icon FuzzyWuzzy
    Full Member

    .

    Premier Icon molgrips
    Free Member

    Also, what platform are you working with?

    The OP said random code, so if that’s what he meant then it’s not derived from the original code. It’d have to be cross-referenced in a DB.

    Premier Icon scuttler
    Full Member

    Requirement sounds more like a tokenisation requirement than encryption.

    https://www.clearent.com/insight/tokenization-vs-encryption/

Viewing 17 posts - 1 through 17 (of 17 total)

You must be logged in to reply to this topic.