Need help decoding a possible encrypted base64 string from API - encryption

I'm on a task to reverse enineering an API to a controller for an oven.
The command for turning on the oven is:
api/directmessages?base64encodedMessage=wkMCUAs=
To turn it off:
api/directmessages?base64encodedMessage=wkMCUAo=
Problem is that I'm not able to decode the base64-string provided in the parameter in any decoder. And i'm kind of stuck.
Anyone seen a string like this that can help me out?

Related

What does this response mean?

This is a response from server of a video file. When seeing the preview in chrome(image) it shows in some characters(Not sure what kind of character is that. If someone know please let me know what is the name of those characters/symbols). Same video response in firefox(image) is seen as base64. So, is the video is transferred to the browser in form of base64 string even when the content type is set to video/mp4(image)? I notice this when i download a pdf file as well. Please explain me. Thanks.
You're looking at something that is binary data, not text, therefore it doesn't show as any ascii characters that make any sense.

Validate if text is actually decrypted from the encrypted text with Solidity

This is a weird question I know, but it happened to be the only thing left stuck on my side project flow.
Okay, so I got this encrypted text on chain (encrypted with a public key I do not have). Now is it possible to validate the authenticity when someone uploads the "supposed" plaintext? Or is there something that the decrypter can provide in order for my contract to verify.
Thank you so much in advance, have been thinking about this for like three weeks.

How to decode polyline from HERE Routing API 8?

In ABAP, we need to fetch detailed route from HERE API https://router.hereapi.com/v8/routes?transportMode=car&origin=21.11336,39.21516&destination=21.52779,39.25381&return=polyline&app_id={APPID}&apiKey={APIKEY}.
This API returns polyline which we need to decode to get GeoCordinates. We tried to decode using the algorithm given at https://github.com/heremaps/flexible-polyline, but it does not provide correct coordinates.
Can I get exact algorithm that HERE is using to encode polyline, so that to decode polyline in ABAP?
I know this is a bit old but found this answer on HERE help pages. An example of an encoded polyline is:
BGo9llkDg_rzZkF0G8LoQ4NoQgP8QoLgKgyB0tB4XoVoLsJ0K4IwWoQsOsJ8LwHoLoGkS0KkN8GsJ0F8GgF4D4DsE0FwHoLUgK8BkIkDkI7B0eTgUT0KjDkhBvCoa7BsT3DwgBvCoVnGg8BjNg4D3D8zB_EsxBjDwgBzFs2BrEgyBvC8V7G8uB7G4wBnBwMkI8BoBnLgP_hEgKz1CsE_nBsJrjD4E1tB
I found the following on developer.here.com page:
"This polyline is encoded using a flexible polyline. You can encode this polyline easily in many major languages using examples available in the flexible polyline repository."
GitHub repo: https://github.com/heremaps/flexible-polyline
"HERE Maps API for Javascript provides wrappers which can do the decoding for you."
I am not using HERE on the client side (even thought it is awesome), I am using some legacy mapping plugin.
I was able to use this code in this file to figure out how to decode the polyline.
https://github.com/heremaps/flexible-polyline/blob/master/javascript/index.js
My code takes the encoded polyline, sends it through the decode method and I end up with a cute object that contains the polyline array as expected.
Below is a screenshot of the console.log of the decoded object pasted above.

How does one expose constants in a java google app engine Endpoints API?

Simple question -- how do you expose constants in a java google app engine Endpoints API?
e.g
public static final int CODE_FOO = 3845;
I'd like the client of the Endpoints to be able to match on CODE_FOO rather than on 3845. I'll end up doing enum wrappers (which probably is better anyway) but I'm just starting to be curious if this is even doable? Thx
Note that this isn't a full answer but here is a workaround: in Android Studio, create a very light-weight "common" java project and shove anything you want to keep in sync there such as constants as well as common types that you want exposed (e.g. an enum representing all possible return / error codes, etc).
This way you should get pretty decent compiler-time safety and keep these guys in sync.
Please feel free to comment if anyone has better suggestions.
This is unfortunately a Law of Information (ahem). If you have a message protocol you defined, both sides of the interaction need to be aware of the messages that could be passed. There's no other way for the client to be aware of what it needs to respond to. Ajax libraries hard-code the number "200" to be able to detect a successful request, as one example.
Yes, just use a switch statement on strings inside your client code. Or, you could use a dictionary of strings pointing to functions and just call the function after de-referencing the dictionary given the string you got.

what is enc={someBase64String} in URL's?

I've noticed on some ASP.net sites that some of their URLs have the following tacked onto some of their internal URLs:
somePage.aspx?enc=looks_like_a_base_64_encoded_string_here=
Any idea what purpose it serves? I've tried passing it through a base-64 decoder, but it's nothing human-readable. Looks like it's usually 64 bytes though.
Just wondering!
I imagine it is a set of query string parameters; Googling around for examples of this behavior, I stumbled on this blog post that talks about encrypting your query string parameters.
There is nothing special in .net for a query string parameter named "enc".
Most likely a number of dev's are just using the same mechanism for encoding querystring parameters.
Who knows, maybe someone started calling this the "Encoded Query String Pattern" ;)

Resources