Results 1 to 6 of 6

Thread: How to determine whether a string is encrypted

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2005
    Posts
    21

    How to determine whether a string is encrypted

    Hi All,

    I have some code that encrypts and decrypts data. I have tested to see if ti works and it does.
    I am using the triple DES cryptography method.

    My question is if I have a password database which stores passwords as normal strings how can i determine whether the string is encrypted or not?

    I have an access database and you cannot encrypt data when entering data into the database.

    From my vb code i want to retrieve the password from the database and check to see if the data is encrypted. If it is then I can decrypt it and if not I want to encrypt it and update the database.

    Any help will be greatly appreciated

    Thanks

    Sunny

  2. #2
    New Member
    Join Date
    Mar 2005
    Posts
    6

    Re: How to determine whether a string is encrypted

    I don't believe this is possible. Both encrypted and decrypted data is valid data. So I don't know how you could look at a string and say "That is not a password - that is an encrypted password" and vice-versa.

    Why can't you encrypt when adding the data to the database?
    Last edited by patrick24601; Apr 14th, 2005 at 04:27 PM. Reason: grammar

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2005
    Posts
    21

    Re: How to determine whether a string is encrypted

    Thanks for your reply.

    To save me the hassle I have just thought of another way for accomplishing this problem.

    Thanks

  4. #4
    New Member
    Join Date
    Mar 2005
    Posts
    6

    Re: How to determine whether a string is encrypted

    Please share - we are always interested in solutions. Who knows - somebody may come along in a week and have the same issue to solve.

  5. #5
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: How to determine whether a string is encrypted

    This is actually quite simple.

    Scan the data and record the range of characters. For example, passwords are usually only made up from a set of 40-50 characters (alphanumerics plus some punctuation), where as encrypted data usually features the whole set of byte values 0-255. Finding the upper and lower ascii values found in the data might indicate whether its a plaintext password or an encrypted one.

    Naturally, the longer the data; the more likely this system is to tell you the right answer. It is by no means foolproof though. You'd also have to take the encoding into account.

    Just an idea.
    I don't live here any more.

  6. #6
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: How to determine whether a string is encrypted

    1. Add salt to your clear passwords before encrypting them. For example "mypass" would be "mypass1234" before encrypting it. Taking, then, the possibly encrypted password and decrypting it should create a string that ends with "1234".
    2. Calculate some kind of parity over the clear values and append to encrypted values, then check that after test-decrypting.

    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width