52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
Yahoo!憟拇撠
望: 璈A
Google憟拇撠
望: 璈A
     
亦: 4189|敺: 0
銝銝銝駁 銝銝銝駁

[蝬脤隡箸沘 Linux銝隞仙HP啣神 3DES(mcrypt) 撖寞(ECB璅∪)[3撘萄]

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-11 21:02:57 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 IT_man 2014-12-11 22:31 蝺刻摩
& N: [' {( [1 n
9 D4 S" h3 s9 \/ v
望潭蝬脩摮撖閬,閬銴撖瞍蝞瘜嚗甇日豢3DES撖
3DES撖(Triple DES)嚗臭撖瞍蝞瘜蝔梧3DES望蝔格芋撘嚗銝V蝝寧浩CB璅∪撖急
擐瑼X召inux臬行摰鋆mcrypt璅∠嚗寞憒銝:

9 h7 K6 w$ X$ `. e0 A
  1. rpm -qa | grep php-mcrypt
銴鋆賭誨蝣

! i" ^& B! g0 y! q  G, ]其蝬脩撱箔php瑼嚗憒phpinfo.php(批捆憒銝)亦臬行mcrypt module
; v7 R9 o& n/ v; B5 B- {
  1. <?php, z& T- f$ |/ M9 ]" B
  2. // Show all information, defaults to INFO_ALL
    % {. B+ b* R$ e: }
  3. phpinfo();) v1 `# ?. ~3 Z# q
  4. ?>
銴鋆賭誨蝣

  |5 l  \# S5 V. p- ]嗅嬌rowser 瑁phpinfo.php嚗蝯憒銝:
/ T1 s' x# U$ ~) ~2 [

4 @* W* ]1 r3 N4 w3 J0 i. k

# a& E) n8 f+ E9 R
憒瘝摰鋆php-mcrypt嚗脰摰鋆(摰鋆寞)嚗摰鋆摰敺隞乩餈啣拍車寞銝隞交炎乓
銋敺撠勗臭誑啣神撖蝔撘憒銝嚗

3 {+ A2 v6 O+ n
  1. //撖賣豢啣神
    7 X; P4 w; L- ^+ o1 f$ m! u
  2. function encrypt($source,$toencrypt){  
    . @+ `9 e+ l+ s% V
  3. //撖函key   3 a3 T. o1 u% I( U
  4. $key = $source;  0 H% R2 g/ G! Y
  5. //雿輻3DES寞撖   ( N  I! ^/ q# ~
  6. $encryptMethod = MCRYPT_TRIPLEDES; 4 I) E. f' O' x; ~8 I
  7. //憪靘憓摰冽
    5 x' X& e. Q. h! R: b
  8. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  7 Z& P7 C. Z) h2 x# j$ D
  9. //雿輻皂crypt_encrypt賣詨撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪6 n- h9 A7 I* g  `, n
  10. $encrypted_toencrypt = mcrypt_encrypt($encryptMethod, $key, $toencrypt, MCRYPT_MODE_ECB,$iv);   
    0 H) J# `; D! I7 z7 }- J2 b; S! S) U
  11. //唾圾撖敺摮銝
    - u& F) w( q' l3 T+ p
  12. return base64_encode($encrypted_toencrypt);  6 r) o% }5 V! _  I
  13. }  " `. g7 ~9 H* s5 M$ x4 Y
  14. //閫撖賣豢啣神
    0 m/ k8 p; Q4 J7 r4 G( v' f4 W. V
  15. function decrypt($source,$todecrypt) {  
    6 P( X* K; D+ h+ `( s9 N
  16. //閫撖函key嚗敹頝撖函key銝璅     K- y, `& a* }' O( z1 k" X! b9 W
  17. $key = $source;  $ b/ j! L+ d# _. V* I- y( [2 V
  18. //閫撖閫base64蝣
    5 N, M  d- v  F) A4 i0 l" z1 W
  19. $todecrypt = base64_decode($todecrypt);/ P. B! ~; q( J) ?2 Z" Z) o; W9 Q( `
  20. //雿輻3DES寞閫撖2 ~, t2 M+ X7 _: H9 V: ~6 a6 ~* i
  21. $encryptMethod = MCRYPT_TRIPLEDES;  4 [) R0 |7 _7 N) `! q2 @
  22. //憪靘憓摰冽 : j% L1 @( s0 L7 [
  23. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  9 _  h9 ~' P* @) [, ]
  24. //雿輻皂crypt_decrypt賣貉圾撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪  
    6 G, V0 z; ~0 A+ m. m# u
  25. $decrypted_todecrypt = mcrypt_decrypt($encryptMethod, $key, $todecrypt, MCRYPT_MODE_ECB,$iv);6 k6 n4 Y$ \5 H1 T1 ^
  26. //唾圾撖敺摮銝* Q: j/ d# p0 U* C! |! a5 ?
  27. return $decrypted_todecrypt;  / s2 v6 Y' i) \9 s" A
  28. }  ( u; g& K0 P! r8 x' ^2 X
  29. //撖怠末閫撖賣訾敺嚗撠勗臭誑靘脰皜祈岫鈭
    % h; d% x- j' X
  30. //key閮剖
    1 h3 I7 W5 k; y% F' ?9 `' H/ `9 C
  31. $source ="1234567890";
    + B2 M, T0 W1 u5 s! m. C
  32. //閬撖摮銝
    * q% }. k5 a8 o3 R
  33. $string ="www.av4u.co";
    . S: D+ O  {. [1 r; f* B5 l1 U4 l
  34. echo "string=".$string."<br>";1 A7 a3 ?% P2 f9 n% P% b
  35. //脰撖銝阡*蝷箏撖敺摮銝
    1 X/ J. L" X; b( ~1 h( E; @) V
  36. $encode = encrypt($source,$string);
    4 y: v! d8 R+ L1 O9 p
  37. echo "encode=".$encode."<br>";. Q5 l% S; l7 y( \- M! z
  38. //脰閫撖銝阡*蝷箄圾撖敺摮銝
    9 r9 \3 T7 x( o4 G4 _
  39. $decode = decrypt($source,$encode);9 n0 A* P" J$ G& R( {
  40. echo "decode=".$decode."<br>";
銴鋆賭誨蝣
7 B% W- ^) N2 K6 G3 n
蝯憒銝:

* [+ q2 @' m- \1 S0 \2 w7 L, H
: F6 `8 K1 N% O
瘜冽:
      憒閫撖蝔瘝雿輻灸ase64蝣潛閰梧頝函雯鞈唾撓嚗交嗥垢⊥閫霈(臬撖敺鞈唾撓航炊嚗雿臬典銝蝬脩抒閫撖舀憿)嚗蝯憒銝:

' h6 D4 B+ u9 Q) ?( d7 u7 ]

雿輻券

祉蝛閬

BT蝳

砍憛批捆靘餉衣雯頝臬批捆蝝颲行粹嗥蝬脩嚗摰撟湔遛嚗嚗甇脖誑銝嗅啣摰嗆摰撟湧翩鈭箏ㄚ孵舫脣伐銝憿亙祉璇甈橘芣遛18甇 雓蝯脣亦閬賬粹脩芣遛18甇脖芣撟渡雯閬賜雯頝臭嗥批捆鞈閮嚗撱箄降典舫脰蝬脰楝批捆蝝蝯蝜ICRA蝝摰鋆閮剖 (粹蝯行霅 祉蝬脣銝蝝瘛函隢憯啣嚗祉閮剜蝞∠)

QQ|撠暺撅||52AV璈A

GMT+8, 2024-12-22 22:59 , Processed in 0.061765 second(s), 19 queries .

蝯∠.撱

52avtv@gmail.com | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵