GithubHelp home page GithubHelp logo

yii2-encrypter's Issues

avoid encryption on null values

Hi, thanks for this very useful extension. I have a question: I have a model attribute that can be null, but if is not, then it must be unique. This check is performed at database level. As far as I understand, the encryption is performed on null fields as well, therefore producing an integrity violation at database level, since the encrypted string resulting from encrypting '' (which is the value of the blank field left as null) is actually not null. Is there already a way to prevent this, or I should work on it? Thank you very much

Per-user encryption

Hey,

thanks for this great extension. In 2015 you wrote:

The current version currently uses a global key for encryption, but in the future I will add an easy way to do per-user encryption.

The only issue with per-user encryption is that you need to generate and store the user key otherwise you'd obviously lose the data. I just want to think about the best approach to include that without either assuming too much stuff or increasing the coupling.

I will probably release a new version next week with per-user encryption anyway!

How about using a PHP callback function to determine the current necessary password, like this:

'password' => function() { return Yii::$app->user->secret; }

Of course, the user needs to ensure that his secret never changes over time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.