Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7442817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:14:01+00:00 2026-05-29T11:14:01+00:00

There is an example HMAC-SHA1 here that works in javascript http://jssha.sourceforge.net/ Text to encrypt

  • 0

There is an example HMAC-SHA1 here that works in javascript

http://jssha.sourceforge.net/

Text to encrypt

vibaHBXwUXFqVSg-+kTrqYJZEJkbVeqLc=bo.LlXGET12505351831husu9039http://api.tineye.com/rest/search/image_url=http%3a%2f%2ftineye.com%2fimages%2ftineye_logo_big.png&limit=30&offset=10

Key

vibaHBXwUXFqVSg-+kTrqYJZEJkbVeqLc=bo.LlX

Output

9e734661c9e8b6dc9b6b4b3def9769c00e8843b8

Issue

I can’t however duplicate the output in Coldfusion. I’m using a function from a previous Stackoverflow.com question

<cffunction name="hmacEncrypt" returntype="binary" access="public" output="false">
   <cfargument name="signKey" type="string" required="true" />
   <cfargument name="signMessage" type="string" required="true" />


   <cfset var jMsg = JavaCast("string",arguments.signMessage).getBytes("iso-8859-1") />
   <cfset var jKey = JavaCast("string",arguments.signKey).getBytes("iso-8859-1") />

   <cfset var key = createObject("java","javax.crypto.spec.SecretKeySpec") />
   <cfset var mac = createObject("java","javax.crypto.Mac") />

   <cfset key = key.init(jKey,"HmacSHA1") />

   <cfset mac = mac.getInstance(key.getAlgorithm()) />
   <cfset mac.init(key) />
   <cfset mac.update(jMsg) />

   <cfreturn mac.doFinal() />
</cffunction>

<cfset result = hmacEncrypt("vibaHBXwUXFqVSg-+kTrqYJZEJkbVeqLc=bo.LlX", "vibaHBXwUXFqVSg-+kTrqYJZEJkbVeqLc=bo.LlXGET12505351831husu9039http://api.tineye.com/rest/search/image_url=http%3a%2f%2ftineye.com%2fimages%2ftineye_logo_big.png&limit=30&offset=10")>

<cfset x1 = toString(tobase64(result))>

This returns

nnNGYcnottyba0s975dpwA6IQ7g=

Any help appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:14:02+00:00Added an answer on May 29, 2026 at 11:14 am
    <cfset x1 = toString(tobase64(result))>
    

    The other function is returning hex, not base64. Other than that it seems to work fine for me:

     <cfset x1 = binaryEncode(result, "hex")>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there any example on using java method to call rhino-javascript function and return
At http://docs.jquery.com/UI/Tabs#Example there is a short HTML example of how to use JQuery UI
Is there an example for the $.ajax() that returns values from a webservice or
Is there example for Eclipse RCP based application that doesn't look like engineering tool,
Are there other example projects like the Northwind Starters kit around that show you
For example there are URLs http://www.subdomain1.domain.com.uk and http://www.subdomain2.domain.uk , from these URLs I need
For example there are lalalalaal.com that do NOT exist. Is there any way using
Ruby code: a = OpenSSL::HMAC.digest('sha1', 'secret', 'example') and then: Base64.encode64(a).chomp yields aMp6Zw1+hHVMmwWXoFp/Aaipc20= iPhone: +
is there any example that shows a asteroid like game with unlimited enemy/asteroids spawning?
Is there any example code for something like that (and somehow changing the URL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.