babuhari123
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2012
02:33 AM
How to Send paramerter values in MD5 format in roTranferURL
Hi friend,
I have one new requirement in my project I need to send parameter using MD5 format in rotransferURL is it possible in Roku,
if possible can any one send me one small snippet for me please........
Thanks in advance
I have one new requirement in my project I need to send parameter using MD5 format in rotransferURL is it possible in Roku,
if possible can any one send me one small snippet for me please........
Thanks in advance
7 REPLIES 7

gonzotek
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2012
08:05 AM
Re: How to Send paramerter values in MD5 format in roTranfe
"babuhari123" wrote:See if this helps:
Hi friend,
I have one new requirement in my project I need to send parameter using MD5 format in rotransferURL is it possible in Roku,
if possible can any one send me one small snippet for me please........
Thanks in advance
http://sdkdocs.roku.com/display/RokuSDKv43/roEVPDigest
Example: MD5 Message Digest with roEVPDigest
ba1 = CreateOjbect("roByteArray")
' ...populate ba1...
ba2 = CreateObject("roByteArray")
ba2.FromAsciiString(somestring)
digest = CreateObject("roEVPDigest")
digest.Setup("md5")
digest.Update(ba1)
digest.Update(ba2)
result = digest.Final()
print result
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
guidamedia2
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2012
06:17 AM
Re: How to Send paramerter values in MD5 format in roTranfe
I am trying to send a hash key to my PHP script and am wondering how digest.Update(ba) formats the array of ascii numbers before it is hashed. I am trying to match the md5 on the PHP side and need to know how to simulate the method with the SDK builds the md5 hash.
The PHP uses $_REQUEST["date"] . "_" . "salt". Just need to know how to build the md5 from there.
digest = CreateObject("roEVPDigest")
digest.Setup("md5")
ba=CreateObject("roByteArray")
ba.FromAsciiString("10032012_salt")
digest.Update(ba)
key = digest.Final()
output.URL = domain + "?key=" + key + "&date=10032012"
The PHP uses $_REQUEST["date"] . "_" . "salt". Just need to know how to build the md5 from there.
guidamedia2
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2012
10:37 AM
Re: How to Send paramerter values in MD5 format in roTranfe
I am still hoping that someone helps me out here.
I can send the MD5 hash to my PHP file, but the issue is digest.Update(ba) converts ba into something other than a simple string that I need to match on the PHP side.
Really all I want to do is something like
Then have my PHP script match the key.
That's it. But you cannot just use a string.
I can send the MD5 hash to my PHP file, but the issue is digest.Update(ba) converts ba into something other than a simple string that I need to match on the PHP side.
Really all I want to do is something like
digest.Update("10032012_salt")
Then have my PHP script match the key.
That's it. But you cannot just use a string.

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2012
11:26 AM
Re: How to Send paramerter values in MD5 format in roTranfe
Not sure if this helps, but here is an md5 signing function I wrote:
hope that is helpful.
-Joel
'******************************
'* sign url with md5 hash
'******************************
function makemdfive(urltosign as string) as string
ba=createobject("robytearray")
dg=createobject("roevpDigest")
dg.setup("md5")
ba.fromasciistring(urltosign)
result=dg.process(ba)
return result
end function
hope that is helpful.
-Joel
guidamedia2
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2012
09:15 AM
Re: How to Send paramerter values in MD5 format in roTranfe
I understand how to send it. The issue is result=dg.process(ba) turns the string into an array. With the PHP md5() function, it requires a string, so I need to understand how to match what Roku generates in this process with the PHP md5().
What I am trying to do is expire requests, and also use a hidden value that both the Roku and Web Service will have to validate the request.
Isn't this common practice for web requests on the Roku?
If so, are there any known examples?
I am searching but found nothing.
What I am trying to do is expire requests, and also use a hidden value that both the Roku and Web Service will have to validate the request.
Isn't this common practice for web requests on the Roku?
If so, are there any known examples?
I am searching but found nothing.

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2012
09:30 AM
Re: How to Send paramerter values in MD5 format in roTranfe
I think you have some fundamental misunderstanding which is why you're not getting a clear response to your question. First of all, roEvpDigest.Process doesn't turn any string into an array. It takes a ByteArray parameter and returns a string, which is the ASCII hex MD5 digest of the byte array. The code you originally posted actually seems to do the right thing, so I'm still not sure what your question is.
--Mark
--Mark

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2012
11:23 AM
Re: How to Send paramerter values in MD5 format in roTranfe
also, if you post your PHP code, perhaps that will help us understand why the output is different.
- Joel
- Joel