Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Encrypt just 1 field?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Encrypt just 1 field?

    Other than the method in one of Peter Wayne's early books, does anyone have a way of encypting just one field that they can share? There would still have to be way for the user to do queries on the field, e.g. the number 123 (actually >123) looks for the encrypted value of @%# or greater. In my current case I am only interested in a numerical field. Also, I would need to be able run an update that would transform a field's normal values (e.g., 565) into the other encrypted field (e.g., @#&). Of course I would much prefer some translation scheme that would be relatively difficult to figure out)

    FYI, I once had some kind of problem (do not remember what) using Peter's method in his book, so I do not want to revisit that.

    Ray


    #2
    RE: Encrypt just 1 field?

    Ray

    There is a method to encrypt just one field, but it does require a little work. In older versions of A5 before table encryption, I had a database that stored social security numbers which obviously must be secure. The solution was to create my own encryption algorithm and encrypt the ss numbers in a second field. Now A5V5 gives you an encryption method with the functions encrypt_string() and decrypt_string()

    Here is how it worked. When the database was opened, a script ran an update on the table. There were two fields in the table for ss number, one encrypted, one not. The update filled in the non-encrypted field by decrypting the encrypted field. The encrypted field was actually a calculated field, so whenever the ss number was entered or edited, the encrypted field immediately changed. Anytime the database was exited, the non-encypted field was blanked out with an update operation, which was very fast. If someone looked at the dbf with any viewer, all they could see was the encrypted field, which was jibberish. The non-encrypted field was blank.

    Jerry

    Comment


      #3
      RE: Encrypt just 1 field?

      You can also use the CanWrite event and the a_field_value system variable to trigger the encryption.

      Character Encrypted_String = ENCRYPT_STRING( Input_String as C [, Key as C ] )

      ? encrypt_string("Alpha Software")
      = "$Z)kd*ky+B#1@"
      ? encrypt_string("Alpha Software", "password")
      = ">jYM?_Po?w'js5"

      ? decrypt_string("$Z)kd*ky+B#1@")
      = "Alpha Software"
      ? decrypt_string(">jYM?_Po?w'js5", "password")
      = "Alpha Software"
      Peter
      AlphaBase Solutions, LLC

      [email protected]
      https://www.alphabasesolutions.com


      Comment


        #4
        RE: Encrypt just 1 field?

        OK and however:

        For anyone interested, it turns out that for use in updates and queries I had to build encryption and decryption functions, ala:

        FUNCTION C_encrypt AS C (Input AS C )
        dim s as c
        s= encrypt_string(input,"memomma")
        C_encrypt = s
        END FUNCTION

        and similarly for decryption.

        In my case the field in question is never input or changed; it gets imported when the table is originally created from an ASCII file. I not only do not want the user to be able to see the value of the decrypted field (I delete the unencrypted field after the update that creates the encrypted value), I do not want a savy A5 user to see it using the the decrypt function. BUT, I need this guy to be able to create his own queries using the encrypted field, something like: C_Decrypt(fld2,"memomma")>"600".

        Of course using a key means only this guy could write the query, but it also means he could create his own calculated field on his own little form and be able to see anyone's very private data (similar to a social security number). The question is, is there any way to stop the latter sort of thing? Contractually, by the way, I am allowed to see this private data, but I am not allowed to let anyone else see it. And yes, even allowing a query at all could in itself pose a problem. Any ideas?

        Ray

        Comment


          #5
          RE: Encrypt just 1 field?

          Ray

          Unless you restrict every access that uses the decrypted number, you can't prevent access. The only solution I see is to find out ahead of time what queries they may need and hard code as many as possible.

          Jerry

          Comment


            #6
            RE: Encrypt just 1 field?

            Jerry,

            I think you are correct. The client wants his computer savvy user to be able to do the queries but if he becomes savvy enough with A5 he could figure out how to decrypt everything. I am going to have to assess the possible legal implications of making this possible.

            Thanks,

            Ray

            Comment


              #7
              RE: Encrypt just 1 field?

              Would it help to move the data out of the table structure?

              Externalize just the high security fields and then acces them over some encrypted process?

              Bo

              Comment


                #8
                RE: Encrypt just 1 field?

                Bo,

                I am not sure exactly what you mean, but I don't see how it would help. We are talking about 400,000+ records. The field could be in a separate table, but how would that stop a savvy user from figuring out how to use the function that decrypts for queries to look at data for an individual? Casual users would never figure it out but you and I could, not to mention many people on this board.

                Ray

                Comment


                  #9
                  RE: Encrypt just 1 field?

                  Ray

                  After rereading your post, any query on an encrypted field could reveal the data in the field. For example, if you are looking for a ss number, but don't have access to the encrypted field, you could design your own query to search for a ss number between 555-55-5555 and 555-55-5557. By continually narrowing the query, you could return any number, without knowing exactly what is in the field. If the field must be secure, then you can't really run any query. The only way any data can be secure is severly limit any access to it.

                  You could easily run a search for a single value. I use encrypted passwords in a number of application. I don't decrypt the actual record, but encrypt the value I am using for the find using the same algorithm as the data stored in the field. For example, if the saved password is "password", I may have used the following to save a value in field in the password table.

                  encrypt_string("password","alpha")
                  returns "i#])B=!T"

                  Now when the user logs on using ui_get_password() or something similar, I take the password they enter, trim it, encrypt it, and search for that value

                  user_password = "password "
                  ?encrypt_string(alltrim("password "),"alpha")
                  = "i#])B=!T"

                  I index the field and search for "i#])B=!T". Of course, trial and error still might eventually find the record anyway. Just how secure must this be and why is this "savvy expert" being granted access?

                  Jerry

                  Comment


                    #10
                    RE: Encrypt just 1 field?

                    I don't follow. If the user can create a query, can't he see everyone's data anyway?
                    Peter
                    AlphaBase Solutions, LLC

                    [email protected]
                    https://www.alphabasesolutions.com


                    Comment

                    Working...
                    X