GithubHelp home page GithubHelp logo

d8-contrib-modules / encrypt Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 11.0 209 KB

DEPRECATED - D8 Encrypt moved to http://drupal.org/project/encrypt

Home Page: http://drupal.org/project/encrypt

PHP 98.17% Shell 1.83%

encrypt's People

Contributors

adam-bergstein avatar damontgomery avatar eclipsegc avatar lahoosascoots avatar nerdstein avatar rlhawk avatar svendecabooter avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

encrypt's Issues

Config links not showing up on admin/config

-Should categorize to "security", like other modules (e.g. Password Policy). /admin/config/security/encryption for SettingsForm
-Need to expose the route from within the admin/config page

Restrict list of available keys to encryption keys

When the user is presented with the list of available keys to use for encryption, it should be filtered so that only keys that match their encryption method are shown. As a first step, we can just filter by key type group ("encryption") and make further adjustments later to improve the behavior. Implementing this means that we will not be able to use the Key Select Form API element yet, since it's not currently possible to filter the key list by key type group.

Remove MCrypt encryption method

It is generally recommended not to use MCrypt in modern web applications and the implementation that currently exists in Encrypt is not secure, so we should remove the MCrypt encryption method from the module. Tests are using this method, so we will need to add some sort of method to the tests. I will create a separate issue for that.

Enforce sizes of keys within Encryption Methods and/or Encryption Profiles

Exception Warning McryptAES256Encry 47 Drupal\encrypt\Plugin\EncryptionMet
mcrypt_encrypt(): Key of size 17 not supported by this algorithm. Only keys
of sizes 16, 24 or 32 supportedmcrypt_encrypt('rijndael-256', 'test this
key out', 'S|9/>&Ysu', 'ecb', '')
Drupal\encrypt\Plugin\EncryptionMethod\McryptAES256Encryption->encrypt('S|9/
>&Ysu',
'test this key out')
Drupal\encrypt\EncryptService->encrypt('S|9/_>&Ysu')
Drupal\encrypt\Tests\EncryptEncryptDecryptTest->testDefaultEncryptDecrypt()
Drupal\simpletest\TestBase->run(Array)
simpletest_script_run_one_test('1',
'Drupal\encrypt\Tests\EncryptEncryptDecryptTest')

Need to do two things:

  1. Enforce key lengths for mcrypt via UI
  2. Update tests to ensure the fake keys used are 16, 24, or 32 chars

Implement plugin collection for encryption method plugin type

The encryption profile configuration entity should take advantage of the benefits of plugin collections by adding a plugin collection for the encryption method plugin type. Key already does this for its three plugin types, so the code can largely be copied from Key.

Using OpenSSL and Defuse PHP-Encryption

In this PR, OpenSSL / Defuse is mentioned and I second this motion. Has there been any effort to making this happen and what can I do to help?

I have standardized on using Real AES for D7 but as far as I know, there is no D8 port yet. This should be the recommended default for D8 Encrypt and not require a separate module.

Don't create profile automatically

I've previously expressed the opinion that we shouldn't create a profile automatically when Encrypt is installed. I still think that's the case and I'd like to be clear about my arguments:

  • Ideally, all encryption methods will be created by a submodule, so that site administrators can specifically choose what sorts of encryption methods are available on their site by enabling or disabling submodules. If there's an automatically-created profile, there will need to be a method that is always available, so it can be used for the profile, which prevents admins from having that control. They could alter the form, but that feels like a less desirable solution.
  • Creating a profile automatically is likely to leave the profile in an unusable state, since it's possible that a default key will not have been set. The user still would need to go the Encrypt profile edit page and select a key. So why not just require them to create the profile themselves to begin with? It's not very helpful to have one created for you if it's not fully functional.
  • It's important when dealing with something as critical as encryption that site administrators are aware of, and fully understand, every aspect of how their data is being encrypted, where the key is, etc. Each part of the process should be completely intentional and thought out. Having anything happen automatically undermines that goal.
  • The Drupal 7 version of Encrypt has an automatically-created default profile, but it's only necessary to stay backward compatible with modules that originally integrated with Encrypt before profiles were introduced in version 2.0. Thankfully, we don't need to worry about that for the Drupal 8 version.

Allow encrypt module to support multiple encryption instances

  1. Change encrypt settings UI to support creation of multiple instances (open to CMI)
  2. Ability to set "default" global encryption instance for the service
  3. Extend the service to be able to specify an instance and not just the default
    ->encryptWithInstance($inst, $string), ->decryptWithInstance($inst, $string)
  4. Validate that machine names/IDs are unique to each encrypt service

Remove LICENSE.txt file

LICENSE.txt gets added automatically by the Drupal.org packaging script, so it shouldn't be included in the Git repository.

Remove the "Basic" encryption method

The "Basic" encryption method is being deprecated in the Drupal 7 version of Encrypt, and it does not need to be included at all in the Drupal 8 version.

Add a simple encryption method for tests to use

Since Encrypt will not include any bundled encryption methods, we will need to have some sort of simple method for tests to use. It doesn't even need to actually involve encryption; it just needs to modify a plaintext value in a reversible way. I propose a basic Rot13 method, because it will fulfill that need and will be easy to write.

Key management changes

There are two really important scenarios to consider.

  1. If a key value changes
  2. If a default key changes

Key is naive - it assumes someone knows how to invoke its service.

Encrypt is less naive - it references a key instance within it's Encryption Profiles. We may need to store or reference a specific revision of a Key entity.

We also should consider a "key change" service that decrypts a string with one Encryption Profile and encrypts the string with a second Encryption Profile.

Remove PHPSecLib encryption method

We are not going to be bundling any encryption methods with Encrypt (for more information, see #60), so the PHPSecLib method should be removed from the project.

Evaluate design of EncryptionMethod plugin type

Use case: mcrypt. Consider either separate plugin types or one plugin type with the settings below.

-Separate submodule of Encrypt
-mcrypt plugin type
-look at cyphers (aes, rjindal, blowfish)
-look at mode (cbc)

Create a test page and drush command to be able test Encryption

Page just has a text field to encrypt and decrypt text. Let you easily test out your key and encryption method configuration.

The same would apply for the drush comand just without the UI drush encryption encrypt "Test" and drush encryption decrypt "avv9wervwen!d"

Clean up .info.yml files

Drupal.org's packaging script automatically adds lines for project and datestamp, so they should be removed from our .info.yml files.

Rename "Configuration" to "Profile"

When I originally wrote the existing system for managing bundles of encryption settings, I used the label "configuration" to refer to them. Since that term has a specific meaning within Drupal 8, we should consider changing it to "profile."

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.