天天看點

4pda.ru注冊驗證的解碼算法

代碼源于看雪林版在我群裡介紹注冊一個俄文安卓論壇,發出來了連結大家在測試注冊。

http://4pda.ru/forum/index.php?

註冊方式請參看:

_https://forum.tuts4you.com/topic/36183-downloading-from-4pda/

打開上面這個網址後,我們可以看到右上角有一個Create Account按鈕,我們點選它:

4pda.ru注冊驗證的解碼算法

如上題,那個驗證注冊的問題一些朋友沒弄明白如何搞出來,于是簡單編寫了下代碼。

這個隻是ascii的8進制編碼而已,我們可以先轉換10進制,然後會很明白看出來是ascii編碼,這裡用代碼直接來進行操作。

倉促之間編寫測試代碼,格式太亂,下面的核心解碼算法還是比較清楚的,大家看一下就明白了。

public class Chhh {
	
	
	 public static void main(String[] args) throws Exception {
		 
		  t1();
		  
		 }
		 public static void t1() throws Exception{

		  String s="127 150 141 164 040 143 145 156 164 165 162 171 040 144 151 144 040 155 141 164 150 145 155 141 164 151 143 151 141 156 163 040 146 151 162 163 164 040 165 163 145 040 160 154 165 163 040 141 156 144 040 155 151 156 165 163 040 163 151 147 156 163 077";//ASCII��

		  String[] chars=s.split(" ");
		  System.out.println("ASCII is \n----------------------");
		  
		  String sa="";
		  
	        for(int i=0;i<chars.length;i++){ 
	        	
//	            System.out.println(ascii8ToString(chars[i]));
	            
	            sa+=ascii8ToString(chars[i]);
	            
	        } 
	        
	        System.out.println(sa);
		 }
		 	
		 
		  public static String asciiToString(String value)
		    {
		        StringBuffer sbu = new StringBuffer();
		        String[] chars = value.split(",");
		        for (int i = 0; i < chars.length; i++) {
		            sbu.append((char) Integer.parseInt(chars[i]));
		        }
		        return sbu.toString();
		    }

		    public static String ascii8ToString(String value)
		    {
		        StringBuffer sbu = new StringBuffer();
		        String[] chars = value.split(",");
		        for (int i = 0; i < chars.length; i++) {
		            sbu.append((char)  (int)Integer.valueOf(chars[i],8));
		        }
		        return sbu.toString();
		    }

		 
}
           

解密後為:

What century did mathematicians first use plus and minus signs?