Audio/video stream recording forums (http://stream-recorder.com/forum/index.php)
-   Video stream recording (http://stream-recorder.com/forum/forumdisplay.php?f=4)
-   -  

how to decrypt and decode png files to real file (.ass)

(http://stream-recorder.com/forum/showthread.php?t=16727)

gaaara 11-10-2013 11:53 PM

how to decrypt and decode png files to real file (.ass)


 
Hi,

I have an coded and encrypted .png file that I would like to decrypt and decode using an « ActionScript » fonction.

I know it’s coded using « basse64 » but I have no ideas what it is encrypted with. This fonction has what it takes to decrypt and decode and I want to use it to get the original .ass file.

I don’t have all the informations but I really am looking forward to make this all work.

Step #1 : Discovery of the encryption
Step #2 : Make the modifications to use the fonction to grab the .ass file.

Quote:

public static function decryptSubtitle(param1:String, param2:String = "5463201897") : String {
var _loc_7:String = null;
var _loc_8:int = 0;
var _loc_9:int = 0;
var _loc_10:int = 0;
var _loc_3:* = new ByteArray();
var _loc_4:String = "";
var _loc_5:int = 0;
while (_loc_5 < param1.length)
{

_loc_7 = param1.substr(_loc_5, 1);
_loc_8 = parseInt(param2.substr(_loc_5 % param2.length - 1, 1));
_loc_9 = _loc_7.charCodeAt(0);
_loc_10 = _loc_9 - _loc_8;
_loc_7 = String.fromCharCode(_loc_10);
_loc_4 = _loc_4 + _loc_7;
_loc_5++;
}
var _loc_6:* = Base64.decode(_loc_4).replace(/?»?""?»?/, "");
_loc_3.writeMultiByte(_loc_6, "iso-8859-1");
return _loc_3.toString();
}// end function
link for this files animedigitalnetwork dot fr/picture_3615.png
A++

KSV 11-11-2013 10:14 AM

Re: how to decrypt and decode png files to real file (.ass)


 
you can use the following php script to decode the subtitles file.

Code:

<?php
  function decryptSubtitle($encrypted, $key = "5463201897")
    {
      $decrypted    = "";
      $encryptedLen = strlen($encrypted);
      $keyLen      = strlen($key);
      for ($i = 0; $i < $encryptedLen; $i++)
        {
          $dataCharCode = ord($encrypted[$i]);
          $keyInt      = substr($key, ($i % $keyLen) - 1, 1);
          $decodedChar  = chr($dataCharCode - $keyInt);
          $decrypted    = $decrypted . $decodedChar;
        }
      $decrypted = base64_decode($decrypted);
      return $decrypted;
    }

  file_put_contents("decrypted_subtitles.txt", decryptSubtitle(file_get_contents("http://animedigitalnetwork.fr/picture_3615.png")));
?>

PS: also don't ask the basic questions like how i can install php or use this script etc. it's trivial to rewrite this script to your language of choice.

gaaara 11-11-2013 11:35 AM

Re: how to decrypt and decode png files to real file (.ass)


 
resolved !! tx

KSV 11-11-2013 10:42 PM

Re: how to decrypt and decode png files to real file (.ass)


 
you have posted my decryption script to several websites without mentioning the original author or this thread. this is not how it's supposed to be. you can't present someone else's work as your own. i have wasted time to look at your problem and come up with a working solution. so atleast give the credit where it's due.

gaaara 11-12-2013 07:06 AM

Re: how to decrypt and decode png files to real file (.ass)


 
sorry I did not think about it .... and I can remove all on your request :(

KSV 11-12-2013 10:50 AM

Re: how to decrypt and decode png files to real file (.ass)


 
Quote:

Originally Posted by gaaara (Post 63908)
sorry I did not think about it .... and I can remove all on your request :(

i am not against sharing of the script. but atleast you could have mentioned the original thread.

karlo2105 11-23-2013 04:39 AM

Re: how to decrypt and decode png files to real file (.ass)


 
Without KSV many streams wouldn't work on VLC, so give him at least credit on what he does. ;)

gaaara 11-23-2013 06:14 PM

Re: how to decrypt and decode png files to real file (.ass)


 
Hello

Quote:

<?php
$formulaire = $_GET['formulaire'];
If ($formulaire==1)
{
$ID = strip_tags(substr($_POST['ID'],0, 100));
$safeID = mysql_escape_string($ID);
$nomfic = strip_tags(substr($_POST['nomfic'],0,100));
$safenomfic = mysql_escape_string($nomfic);
$verif = $_POST['parpost'];

if ($verif == "jeverifiequecapasseparformulaire")
{

function decryptSubtitle($encrypted, $key = "5463201897")
{
$decrypted = "";
$encryptedLen = strlen($encrypted);
$keyLen = strlen($key);
for ($i = 0; $i < $encryptedLen; $i++)
{
$dataCharCode = ord($encrypted[$i]);
$keyInt = substr($key, ($i % $keyLen) - 1, 1);
$decodedChar = chr($dataCharCode - $keyInt);
$decrypted = $decrypted . $decodedChar;
}
$decrypted = base64_decode($decrypted);
return $decrypted;
}

file_put_contents($safenomfic, decryptSubtitle(file_get_contents("http://animedigitalnetwork.fr/picture_".$safeID.".png")));
}
else
{
print "Erreur pas de formulaire détecté";
}
}
else
{
?>
<html>
<head><title>Get ADN Subtitles</title>
<body>
<form action="index.php?formulaire=1" method="post">
ID : <input type="text" name="ID">
Nom fichier : <input type="text" name="nomfic">
<input type="hidden" name="parpost" value="jeverifiequecapasseparformulaire">
<input type="submit" value=" Submit ">
</form>
</body>
</head>
</html>
<?php
}
?>
I want to make a form to retrieve the file but I can not manage to do what am
a pop to download the file

and would like to center the form in the center of the image http://i.imgur.com/dkHJSZR.png

sorry for my english :(

tx

Liluy 04-15-2014 05:16 AM

Re: how to decrypt and decode png files to real file (.ass)


 
Thanks, KSV, for the script.
The Key 5463201897 no longer works.
Do you have the solution for the new key?

http://animedigitalnetwork.fr/picture_4916.png

PS : Sorry if my English is not perfect.

gaaara 04-16-2014 12:51 AM

Re: how to decrypt and decode png files to real file (.ass)


 
I am looking for the solution :)

links that may be useful
http://stackoverflow.com/questions/8...-encrypted-xml
http://stackoverflow.com/questions/2...448441#2448441
http://stackoverflow.com/questions/1...ryption-in-php

aes in swf
http://pastebin.com/71rD0KNb
xml
http://pastebin.com/QHxsX20H

the encrypted code possibly this code im not sure yet

50,52,115,98,117,109,54,100,122,102,56,114,101


All times are GMT -6. The time now is 07:13 PM.