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

MySQL Encryption (Fields in a table)

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

    MySQL Encryption (Fields in a table)

    I would like to encrypt 3 fields in a MYSQL table, I have absolutely no clue how to do this. If it's easier to encrypt the entire table that would work too.

    I think there is a way to un-encrypt within the connection string, but it's over my head.

    I would really appreciate any help at all. Thanks so much

    #2
    Re: MySQL Encryption (Fields in a table)

    http://wiki.alphasoftware.com/Encryption+Algorithms

    http://wiki.alphasoftware.com/Encryption+Functions

    There are also MySQL methods - e.g.

    http://www.w3resource.com/mysql/encr..._encrypt().php
    Peter
    AlphaBase Solutions, LLC

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


    Comment


      #3
      Re: MySQL Encryption (Fields in a table)

      Peter - have you ever used this stuff in an app, and have advice or experience to share?
      -Steve
      sigpic

      Comment


        #4
        Re: MySQL Encryption (Fields in a table)

        Steve,

        I have used some of the A5 methods (on MySql) but not the "MySQL" methods.
        Peter
        AlphaBase Solutions, LLC

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


        Comment


          #5
          Re: MySQL Encryption (Fields in a table)

          Peter do you know if you can you use MySQL AES_ENCRYPT() function on a connection string?

          Comment


            #6
            Re: MySQL Encryption (Fields in a table)

            I'm guessing not. If you got to your published folder and examine the a5_application.a5i file, you will see your connection string with password encrypted in the <<%txt% %txt% blocks. So I don't think any xbasic, much less MySql commands will run there.
            Peter
            AlphaBase Solutions, LLC

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


            Comment


              #7
              Re: MySQL Encryption (Fields in a table)

              Okay, thanks for your input Peter :-)

              Comment


                #8
                Re: MySQL Encryption (Fields in a table)

                Just curious - what are you trying to do exactly, if I may ask?
                Peter
                AlphaBase Solutions, LLC

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


                Comment


                  #9
                  Re: MySQL Encryption (Fields in a table)

                  I am building a HIPAA web based software which is a SAAS program. We have gone back and forth on if we should or shouldn't encrypt the data in the table and my client has decided that this is something they want done, just to be safe. I figured instead of encrypting the entire database we could just encrypt the patients first name, last name and birthday and that would mean all the rest of the data wont matter because you can't tie it to someone specifically.

                  I just don't really understand this enough yet to know what is best to do. I know I could pay to have the entire database encrypted with monthly fees but that really isn't ideal for my client.

                  Comment


                    #10
                    Re: MySQL Encryption (Fields in a table)

                    I don't think the connection string is the way to do that in any case. But, strictly speaking your MySql db is already encrypted - that's why you have a root password and user permissions. I'm not sure HIPAA requires you to anything further on the backend?
                    Peter
                    AlphaBase Solutions, LLC

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


                    Comment


                      #11
                      Re: MySQL Encryption (Fields in a table)

                      That's what Steve said, I think I will research that part more so that I can better explain it to my client. I appreciate the insight. Thank you :-)

                      Comment


                        #12
                        Re: MySQL Encryption (Fields in a table)

                        HIPAA rules change this month. Fines jump to 50K for the vendors and the users. They way we understand it, the data must be encrypted in transit and at rest. We encrypt the entire database so that a DBA in a hosted environment can't see any of the data with a query. The database backup needs to be encrypted as well. We also encrypt the PDF that would run as a report. The PDF can be stored locally so it needs a password. Just some things to think about.

                        Comment


                          #13
                          Re: MySQL Encryption (Fields in a table)

                          Originally posted by Peter.Greulich View Post
                          I don't think the connection string is the way to do that in any case. But, strictly speaking your MySql db is already encrypted - that's why you have a root password and user permissions. I'm not sure HIPAA requires you to anything further on the backend?
                          I'm not sure HIPAA requires you to anything further on the backend? - Not sure on HIPAA requirements - however, in PCI compliance certain fields must either: not be stored, or stored encrypted.

                          I would disagree with this completely. The root password is not for encryption. "Secure Data" and "Encrypted Data" are absolutely not the same thing. E.g If someone gets a hold of your root password, can they read your data in plain text? Yes. Therefore, not encrypted. I digress.

                          Anyways to the OP:
                          Regarding data to be encrypted "in transit" - this would require an SSL certificate and your site would run over https:// and not http://

                          As a second note, if the system is going to send emails, be aware that emails are sent to the smtp server AS PLAIN TEXT (unless smtp requires SSL) and even then, I Think when other servers send these email to the client they are sent as plain text - just to be safe, I wouldnt include sensitive information in emails. If at any point in transit these are plain text - a sniffer sitting in between the proper connection e.g (your server and smtp server), (smtp server and client smtp server) - can see the email.


                          As a 3rd note, field level encryption, here is simple encryption/decryption.
                          The second parameter is your encryption key. Make this long!!! (As long as the algorithm supports) - AND KEEP THIS THING SAFE. THERE IS NO WAY TO DECRYPT WITHOUT IT. ALSO - IF SOMEONE HAS THIS KEY, THEY CAN DECRYPT YOUR DATA BY GUESSING THE ALGORITHM!!!!

                          Also - Dont store this key in the database!!! - If someone knows your root password, they can grab your encryption key and decrypt the data - Store this key somewhere else.
                          File on the server (AND SECURE THAT SERVER!) or in the alpha app (AND SET ENCRYPT TOKENS ON IN YOUR FUNCTIONS).

                          OBFUSCATION - Dont say dim SIN_NUMBER as C=decrypt_string(data.SIN_NUMBER,GETMYENCRYPTIONKEY()) - Anyone with 1/10th of a brain knows exactly what that line does.
                          Instead..who knows... dim registration_number as C=a5s_decrypt_string(data.registration_number,registrationNumberToken()) 'who cares about a registration number? - no one stealing data is probably going to care about a registration number and theyll wonder why in the world you encrypted it. anyways. you can do little things like this to add confusion - if youre going to do something like this, you might want to document it

                          The third parm (not shown) is the encryption algorithm (by default this is blowfish). I would recommend blowfish or aes. Go read on these and make your own decisions
                          http://wiki.alphasoftware.com/~alpha...tring+Function
                          Code:
                          dim encrypted_string as C=a5_encrypt_string("mystring","aosdko012i40214k1024k0k02912150951051025909")
                          ?encrypted_string
                          = "j/Ux/Ya0je8WP7d+vZZn0w=="
                          
                          dim decrypted_string as C=a5_decrypt_string(encrypted_string,"aosdko012i40214k1024k0k02912150951051025909")
                          ?decrypted_string
                          = "mystring"
                          Now that you have that simple concept, you can use the onBeforeSQLCommandExecute to encrypt values.
                          And then use one of the load/render events to decrypt values (onExistingRowRender might be your best bet here)
                          Last edited by aburningflame; 09-11-2013, 12:31 PM.
                          Scott Moniz - Computer Programmer/Analyst
                          REA Inc.
                          http://reainc.net
                          (416)-533-3777
                          [email protected]

                          REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
                          If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
                          contact us to discuss options.

                          Comment


                            #14
                            Re: MySQL Encryption (Fields in a table)

                            Originally posted by RankFirstPro View Post
                            Peter do you know if you can you use MySQL AES_ENCRYPT() function on a connection string?
                            Connection string is encrypted by Alpha.
                            Are you storing multiple connection strings in a database and loading these into DynamicConnection? If so you would need to encrypt the string when you store it and then decrypt it before use if connection string security is a concern.
                            Scott Moniz - Computer Programmer/Analyst
                            REA Inc.
                            http://reainc.net
                            (416)-533-3777
                            [email protected]

                            REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
                            If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
                            contact us to discuss options.

                            Comment


                              #15
                              Re: MySQL Encryption (Fields in a table)

                              Can you explain the format for accessing the fields in theonBeforeSQLCommandExecute event. for instance e.datasubmitted.field? It is not clear to me from looking at different videos and in the Alpha Wikipedia how to access that data.
                              Richard Urban

                              Grocery Delivery Software for Stores and Entrepreneurs: http://www.urbangrocery.com

                              Comment

                              Working...
                              X