top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

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

+1 vote
95 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?

+2 votes

I have function in python,(Assume that i have imported all necessary module),

 def DL_Iperf(args):
        ssh=paramiko.SSHClient()
        ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
        ssh.connect(server_ip,username="root",password=Password)
some_code

This function is actually a thread and it will be created as many no of UE i have, (Ex: if i have 1 UE than 1 Thread will be created),

So, if i have 1 UE/ 2 UE than its working but if i have 3 UE then it is failing, with error "Paramiko : Error reading SSH protocol banner",

Below is the stderr of the script,

    No handlers could be found for logger "paramiko.transport"

    Unhandled exception in thread started by <function DL_Iperf at 0x02B8ACF0>
    Traceback (most recent call last):

    File "C:\Users\qxdm-5\Desktop\Chirag\LTE_11_Perfect_Working\TCP_Latest_2\Windo
    ws_UE\slave.py", line 379, in DL_Iperf

    ssh.connect(ServerIp,username="root",password=Pwd)

    File "build\bdist.win32\egg\paramiko\client.py", line 295, in connect

    File "build\bdist.win32\egg\paramiko\transport.py", line 451, in start_client

paramiko.SSHException: Error reading SSH protocol banner

From some reference i found that this is because of some network related issue, but my question is if it network related then why everytime in 3rd call of the function i am getting this error? And how do i resolve it?

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
...