//сам алгоритм
private function descriptBFF(base64:String) : String
{
var s:String = "";
var i:uint = 1;
var length:uint = base64.charCodeAt(0);
if(length % 2 == 1)
{
length--;
}
while(i < length)
{
s = s + (base64.charAt(i + 1) + base64.charAt(i));
i = i + 2;
}
s = s + base64.slice(length + 2);
return s;
}
//его использование
b64 = new Base64Decoder();
b64.decode(this.descriptBFF(book.bytearray));
//Алгоритм
public static string DecryptBFF(string base64) {
string s = "";
int i = 1;
int lenght = (Int32)base64[0];
if(lenght % 2 == 1) {
lenght--;
}
while(i < lenght) {
s = s + (base64[i + 1] + base64[i]);
i = i + 2;
}
s = s + base64.Substring(lenght + 2);
return s;
}
//Использование
byte[] data;
data = Convert.FromBase64String(DecryptBFF(book.Content));
book.Content = Encoding.UTF8.GetString(data);
s = s + (base64[i + 1] + base64[i]);
s = s + (base64[i + 1].ToString() + base64[i].ToString());
byte[] data;
data = Convert.FromBase64String(DecryptBFF(book.Content));
File.WriteAllBytes("output.swf", data);