Skip to main content
Known Participant
August 1, 2014
Question

CF10 - returntype JSON HTTPS - Input length must be multiple of 16 when decrypting with padded cipher

  • August 1, 2014
  • 1 reply
  • 1005 views

I have a ColdFusion service that doing basic authentication using SQL and returning a structure as JSON

The structure has one element AUTHENTICATED = true . The JSON looks like below

{

  "AUTHENTICATED": true

}

The service works just fine when using HTTP but when using HTTPS I get this error  .

An error occurred while trying to encrypt or decrypt your input string: Input length must be multiple of 16 when decrypting with padded cipher.

This topic has been closed for replies.

1 reply

Known Participant
August 7, 2014

Can anyone help me with this please?

BKBK
Community Expert
Community Expert
August 7, 2014

Could you show us the code that is causing the error?

Known Participant
August 7, 2014

<cfcomponent accessors="true">

    <cffunction name="loginUser" access="remote" returntype="struct" returnformat="JSON" >

        <cfargument name="username" type="string" required="yes">

        <cfargument name="password" type="string" required="yes">

  <cfargument name="applicationId" type="string" required="yes">

  

        <cfif GetAuthUser() neq "">

            <cflogout>

        </cfif>

  

        <cfset var retargs = StructNew()>

        <cfset retargs.authenticated="NO">

        <cflogin>

             <cfset euserArray = new doeadmin.services.everifyUserService().login(arguments.username, arguments.password) />

             <cfset userCount = new doeadmin.services.everifyUserService().searchCount(arguments.username, arguments.password) />         

             <cfif userCount eq 1>

                <cfset retargs.authenticated="YES">

                <cfset session.uuid = #euserArray[1].getUserId()#>

                <cfset session.firstName = #euserArray[1].getFirstName()#>

                <cfloginuser name="#arguments.username#" password="#arguments.password#" roles="">

             <cfelse>

                   <cfset retargs.authenticated="NO">

             </cfif>

        </cflogin>

        <cfreturn retargs>

    </cffunction>

  

    <cffunction name="logoutUser" access="remote" returntype="string" >

        <cflogout/>

        <cfreturn "YES"/>

    </cffunction>

</cfcomponent>