top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

What are the Possible reason that I am getting this Encryption error for changing in PHP Version?

+1 vote
142 views

I have changed my Php version from 7 to 5.
I got this error ==>

mcrypt_encrypt(): Key of size 10 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported

How to fix this?

posted Apr 25, 2016 by Pratiksha Shetty

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

In previous versions keys and IVs were padded with '\0' bytes to the next valid size which is not in the later versions. Try the following solutions -

1) Pad the key with "\0" which previous versions were doing for you

$key=$key."\0";

2) in case option 1 does not work try the following functions

function pad_key($key){
    // key is too large
    if(strlen($key) > 32) return false;

    // set sizes
    $sizes = array(16,24,32);

    // loop through sizes and pad key
    foreach($sizes as $s){
        while(strlen($key) < $s) $key = $key."\0";
        if(strlen($key) == $s) break; // finish if the key matches a size
    }

    // return
    return $key;
}
answer Apr 26, 2016 by Salil Agrawal
Similar Questions
+1 vote

enter image description here

This pic is what i am geting error response from server(HTTP 406). Actually i am trying to post some content from CKeditor, but normal text with styles type of content is accepting by server when i add table content server not accepting.

+2 votes

user:~$ kdenlive
qrc:/qml/kdenliveclipmonitor.qml:2:1: module "QtQuick.Controls.Styles" is not installed
qrc:/qml/kdenliveclipmonitor.qml:1:1: module "QtQuick.Controls" is not installed
qrc:/qml/kdenliveclipmonitor.qml:2:1: module "QtQuick.Controls.Styles" is not installed
qrc:/qml/kdenliveclipmonitor.qml:1:1: module "QtQuick.Controls" is not installed
Segmentation fault (core dumped)

0 votes

Recently, I have installed latest node version. But I need to install node version 6 instead of latest version.

Can anyone suggest how to downgrade? I'm new to node.js.

+3 votes

Is there a particular reason or is it that it's just not bothered being built that often that new versions of Git is released?

How can I build new versions of Git myself?

+4 votes

Does the application compiled on higher sdk version work with lower API?

compileSdkVersion 23

This is my sdk version.

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...