逆向工程base64算法和文本编码/字符集

时间:2017-12-06 08:29:21

标签: character-encoding base64

我试图找出字符串的pre-base64编码统计数据以及用于编码它的算法,这样我就可以编辑解码的json字符串,然后用相同的编码重新编码。

我能够解码原文。但我无法复制编码。

编码文字示例:

6gYAAAAAAAB7ACIAbQBUAGUAeAB0AFAAYQByAGEAbQAiADoAewAiAG0AQQBsAGkAZwBuAG0AZQBuAHQAIgA6ADAALAAiAG0ARABlAGYAYQB1AGwAdABSAHUAbgAiADoAWwBdACwAIgBtAEgAZQBpAGcAaAB0ACIAOgAxADYANwAsACIAbQBIAGkAbgBkAGkARABpAGcAaQB0AHMAIgA6AGYAYQBsAHMAZQAsACIAbQBJAG4AZABpAGMAIgA6AGYAYQBsAHMAZQAsACIAbQBJAHMAVgBlAHIAdABpAGMAYQBsAFQAZQB4AHQAIgA6AGYAYQBsAHMAZQAsACIAbQBMAGUAYQBkAGkAbgBnACIAOgAwACwAIgBtAEwAaQBnAGEAdAB1AHIAZQBzACIAOgBmAGEAbABzAGUALAAiAG0AUgBUAEwAIgA6AGYAYQBsAHMAZQAsACIAbQBTAGgAYQBkAG8AdwBBAG4AZwBsAGUAIgA6ADEAMwA1ACwAIgBtAFMAaABhAGQAbwB3AEIAbAB1AHIAIgA6ADAALAAiAG0AUwBoAGEAZABvAHcAQwBvAGwAbwByACIAOgAwACwAIgBtAFMAaABhAGQAbwB3AE8AZgBmAHMAZQB0ACIAOgAxADAALAAiAG0AUwBoAGEAZABvAHcATwBwAGEAYwBpAHQAeQAiADoAMQAwADAALAAiAG0AUwBoAGEAZABvAHcAVgBpAHMAaQBiAGwAZQAiADoAZgBhAGwAcwBlACwAIgBtAFMAdAB5AGwAZQBTAGgAZQBlAHQAIgA6AHsAIgBtAEIAYQBzAGUAbABpAG4AZQBTAGgAaQBmAHQAIgA6AHsAIgBtAFAAYQByAGEAbQBWAGEAbAB1AGUAcwAiADoAWwBbADAALAAwAF0AXQB9ACwAIgBtAEYAaQBsAGwAQwBvAGwA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ABmAHUAbgBnAGUAcgBlAHIAIABpAGsAawBlAFwAcgBcAHIAIgAsACIAbQBUAHIAYQBjAGsAaQBuAGcAIgA6AHsAIgBtAFAAYQByAGEAbQBWAGEAbAB1AGUAcwAiADoAWwBbADAALAAwAF0AXQB9ACwAIgBtAFQAcwB1AG0AaQAiADoAewAiAG0AUABhAHIAYQBtAFYAYQBsAHUAZQBzACIAOgBbAFsAMAAsADAAXQBdAH0AfQAsACIAbQBUAGEAYgBXAGkAZAB0AGgAIgA6ADQAMAAwACwAIgBtAFcAaQBkAHQAaAAiADoAMQAyADYAMgB9ACwAIgBtAFYAZQByAHMAaQBvAG4AIgA6ADEAfQA=

解码示例:

{"mTextParam":{"mAlignment":0,"mDefaultRun":[],"mHeight":167,"mHindiDigits":false,"mIndic":false,"mIsVerticalText":false,"mLeading":0,"mLigatures":false,"mRTL":false,"mShadowAngle":135,"mShadowBlur":0,"mShadowColor":0,"mShadowOffset":10,"mShadowOpacity":100,"mShadowVisible":false,"mStyleSheet":{"mBaselineShift":{"mParamValues":[[0,0]]},"mFillColor":{"mParamValues":[[0,16777215]]},"mFillOverStroke":{"mParamValues":[[0,true]]},"mFillVisible":{"mParamValues":[[0,true]]},"mFontName":{"mParamValues":[[0,"LucidaGrande"]]},"mFontSize":{"mParamValues":[[0,100]]},"mKerning":{"mParamValues":[[0,0]]},"mStrokeColor":{"mParamValues":[[0,16777215]]},"mStrokeVisible":{"mParamValues":[[0,false]]},"mStrokeWidth":{"mParamValues":[[0,1]]},"mText":"Faen dette fungerer ikke\r\r","mTracking":{"mParamValues":[[0,0]]},"mTsumi":{"mParamValues":[[0,0]]}},"mTabWidth":400,"mWidth":1262},"mVersion":1}

注意:文本开头有一个ACK字符。

我尝试了几种字符集和编码组合。主要是UTF-16(大端,小端,有和没有字节顺序标记)因为我怀疑由于长度的符号是16位。

有没有办法轻松找出字符集和编码以及是否有特定的base64实现?

1 个答案:

答案 0 :(得分:0)

我想通过使用标准的python base64进行解码。我试过的所有java库都忽略了每个字节填充的一堆0x00字节。

事实证明,由于某些原因,我从未设法推理使用带有0x00填充的Latin1。