This is a great module. However:
1. Is there any reason why you are using DES instead of AES?
2. Also, should allow user to choose AES-128 or AES-256.
3. It would be really nice if you implement getKey() to allow custom key management.

CommentFileSizeAuthor
#2 using_encryption_module-1474930-2.patch29.32 KBcaiovlp

Comments

tedbow’s picture

My plan is to change this module to use the Encryption module instead of having its own encryption funcitons.

caiovlp’s picture

Status: Active » Needs review
StatusFileSize
new29.32 KB

I removed the encryption functions from this module and added the encrypt module as a dependency. I also took out the part where it was asking for a phrase as the encrypt module already handles keys in a more secure way.

Tested all three encryption methods (none, simple, mcrypt aes 256) that come out of the box when installing the encrypt module. Also tried changing between them and it works perfectly to my surprise.

I had to use utf8_encode/utf8_decode as encrypted strings were not utf8 and were blowing my database - I'm not sure if this is the best approach, but it works.

Let me know what you think.

wbridger’s picture

Thanks caiovpl for the patch.

I tried #2 but got the error message below when applying the patch:
patch -p1 < using_encryption_module-1474930-2.patch
patching file field_encrypt.admin.inc
patching file field_encrypt.cache.inc
patching file field_encrypt.inc
patching file field_encrypt.info
Hunk #1 FAILED at 8.
1 out of 1 hunk FAILED -- saving rejects to file field_encrypt.info.rej

For info the content of field_encrypt.info.rej is
--- field_encrypt.info
+++ field_encrypt.info
@@ -8,4 +8,5 @@
files[] = field_encrypt.cache.inc

dependencies[] = field
-dependencies[] = field_ui+dependencies[] = field_ui
+dependencies[] = encrypt

For info, I had the module encrypt enabled when applying the patch.
I tried applying the patch prior and after enabling field_encrypt

Best.

caiovlp’s picture

@wbridger thanks for trying! I think there's an issue with trailing whitespaces somewhere... I'm able to apply the patch on a Mac, but not on Windows. I tried regenerating the patch without luck. What worked for me was ignoring whitespaces:

git apply -v using_encryption_module-1474930-2.patch --ignore-whitespace
Checking patch field_encrypt.admin.inc...
Checking patch field_encrypt.cache.inc...
Checking patch field_encrypt.inc...
Checking patch field_encrypt.info...
Applied patch field_encrypt.admin.inc cleanly.
Applied patch field_encrypt.cache.inc cleanly.
Applied patch field_encrypt.inc cleanly.
Applied patch field_encrypt.info cleanly.

Can you please try that?

Thanks,
Caio

caiovlp’s picture

Status: Needs review » Fixed

Committed to 7.x-1.0-beta1.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.