Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 339657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:32:36+00:00 2026-05-12T10:32:36+00:00

I work with symfony framework and Propel and i was wandering what is the

  • 0

I work with symfony framework and Propel and i was wandering what is the easiest way to encrypt a database. I’m not talking about passwords but all the database . I built a small web application for a client that manages some information (user accounts, passwords etc) and i don;t want it to be visible if someone has access to phpmyadmin for example.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:32:37+00:00Added an answer on May 12, 2026 at 10:32 am

    Well this might be a bit naive, but how about simply encrypting on the server [php I assume] side before you write to the DB and then decrypting it back when you do reads ? It looks like your issue is you don’t want a server admin to easily read your data. If you use Symfony, you can probably do this deep enough in the model that your code won’t have to change.


    After some digging, here is how I would do it if I were feeling particularly brave.

    Edit buildParams() in xxx/symfony/vendor/propel/util/BasePeer.php, on like 860 you will find

    $params[] = array('column' => $crit->getColumn(), 'table' => $crit->getTable(), 'value' => $crit->getValue());
    

    change to

    $params[] = array('column' => $crit->getColumn(), 'table' => $crit->getTable(), 'value' => your_encryption_method($crit->getValue()));
    

    (unless I missed something) all symfony/propel writes to the database will eventually end up calling that function, so everything you write to the db gets encrypted with your_encryption_method().

    Try this out and if it works and you’re still feeling brave, modify the addHydrate() function in xxx/symfony/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5BasicObjectBuilder.php (line 668) so that the hydrate() code propel generates for you when you call symfony propel-build-model or symfony-propel-build-all will automatically decrypt everything from the database.

    it should currently look like

                                        case PropelTypes::DATE:
                            case PropelTypes::TIME:
                            case PropelTypes::TIMESTAMP:
                                $script .= "
                \$this->$clo = \$rs->get$affix(\$startcol + $n, null);
    ";
                                break;
                            default:
                                $script .= "
                \$this->$clo = \$rs->get$affix(\$startcol + $n);
    ";
    

    you want to modify it to something along the lines of

    case PropelTypes::DATE:
                            case PropelTypes::TIME:
                            case PropelTypes::TIMESTAMP:
                                $script .= "
                \$this->$clo = \$rs->get$affix(\$startcol + $n, null);
    ";
                                break;
    
                            default:
                                $script .= "
                \$this->$clo = \my_decryption_function($rs->get$affix(\$startcol + $n));
    ";
    

    After you make this change, run symfony propel-build-model and let me know if it worked :-). Good luck and you probably already know this, but make backups of these files before you modify them…. oh and since you’re modifying core symfony, your other projects will have issues unless you want them all to write encrypted data to the db

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to develop using a framework called Symfony but I do not have
I am beginning to work with Symfony, I've found some documentation about inheritance. But
I tried this this solution, but it seams not to work in Symfony 1.4.
we using symfony 1.0. We have an module work with Propel objects. The sql-querys
I've been developing in the Symfony framework for quite a time, but now I
I´m working on a huge project at my work. We have about 200 database
symfony getLayout does not seem to work when layout is set via view.yml. Is
I am trying to make Doctrine 2 work. But on the documentation page about
We are about to start a project and we believe Symfony framework will make
I need some tips on how to work with assets in Symfony 2. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.