Closed (fixed)
Project:
Encrypt
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Jun 2011 at 21:28 UTC
Updated:
8 Oct 2012 at 20:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
theunraveler commentedSome debugging messages when trying to encrypt and decrypt the string "Jake". It seems to me like drupal_strlen is incorrectly determining the length of the encrypted string, perhaps because it's encoded weirdly.
Comment #2
theunraveler commentedAny thought on this, @zzolo?
Comment #3
zzolo commentedI am not sure. I copied the encryption algorithm from a random site.
I have not tested the D7 version of this module yet. I am pretty sure this was working in D6. If that is the case then maybe drupal_strlen() changed in some? Or if there are other Drupal API's used there.
Comment #4
theunraveler commented@zzolo: how would you feel about just getting rid of the basic encryption method? Between mCrypt, OpenSSL, etc., surely users will have a secure alternative to a one-off mathematical encryption method.
Just some thoughts.
Comment #5
zzolo commentedHi @theunraveler. Well, my main goal with the basic encryption method was to provide a way for encryption if no related PHP extensions were installed. Mcrypt is not included by default, last time I checked. I also think supporting the upgrade path for it would be nice, as people will lose data if they have encrypted through this method and then upgrade and cannot decrypt.
But, I don't have much time for it, so if you do want to take it in a certain direction, I am alright with that.
Comment #6
theunraveler commentedAlright, so it looks like it's some kind of bug with character encoding in drupal_strlen() and drupal_substr(). I'm not sure what the exact cause is, but I changed those two functions to their vanilla PHP equivalents and things work fine. Just as a note: 6.x uses the PHP functions as well, not the Drupal wrappers.
I'm marking as postponed for now, because I'd like to find out the real reason.
For now, this has been committed to 7.x-1.x and 7.x-1.0-rc1.
Comment #7
theunraveler commentedComment #8
Dave Sandilands commentedsubscribe
Comment #9
gregglesI agree it makes sense to keep some simple-ish methods in place as long as they work :)
I did some tests on the 7.x-2.x branch and it seems to work. From comment #6 it seems like this is fixed for 7.x-1.x and above, but maybe not for 6.x. Should this be moved back to 6.x and marked as patch (to be ported)?
Comment #10
gregglesPardon me, I read comment #6 wrong. It appears that this issue is actually fixed as long as we don't use the drupal_substr and drupal_strlen commands which none of the branches are currently doing, so fixed.