52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-11 21:02:57 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 IT_man 2014-12-11 22:31 蝺刻摩
# I( d# A% ^. I# i6 D* Q% E0 M" X; l  K; z: N. q' ], V
望潭蝬脩摮撖閬,閬銴撖瞍蝞瘜嚗甇日豢3DES撖
3DES撖(Triple DES)嚗臭撖瞍蝞瘜蝔梧3DES望蝔格芋撘嚗銝V蝝寧浩CB璅∪撖急
擐瑼X召inux臬行摰鋆mcrypt璅∠嚗寞憒銝:

) u( {1 _8 Y% f3 V& o
  1. rpm -qa | grep php-mcrypt
銴鋆賭誨蝣

' v0 g+ L7 ?0 E8 e5 H+ \其蝬脩撱箔php瑼嚗憒phpinfo.php(批捆憒銝)亦臬行mcrypt module
# d+ s5 F" i- o; \
  1. <?php" g2 k4 B! A: b/ O; H# |' r& m9 H
  2. // Show all information, defaults to INFO_ALL
    + ?, J. t0 |9 m9 M8 f! R
  3. phpinfo();7 c6 n" g* b9 F# ]' y
  4. ?>
銴鋆賭誨蝣

2 _) W0 e) W4 G* d1 H0 s: ^: }嗅嬌rowser 瑁phpinfo.php嚗蝯憒銝:

5 c" P/ s: F6 l/ g
* W8 n9 p9 y& @" P

& p+ Y) r2 l# w# ]/ M$ j
憒瘝摰鋆php-mcrypt嚗脰摰鋆(摰鋆寞)嚗摰鋆摰敺隞乩餈啣拍車寞銝隞交炎乓
銋敺撠勗臭誑啣神撖蝔撘憒銝嚗
2 s  k: g2 r( B
  1. //撖賣豢啣神5 _" N5 A: P7 ~+ X& Y! V1 x  }
  2. function encrypt($source,$toencrypt){  
    ( x- j+ u4 q2 @* X
  3. //撖函key   
    ' F! G8 _& d9 ?: R& F
  4. $key = $source;  * P6 M5 B+ R2 O/ W
  5. //雿輻3DES寞撖   " r, j& F1 ~" ^" |  {8 @" r
  6. $encryptMethod = MCRYPT_TRIPLEDES;
    ' [+ _: W* e% i& P% T, Y- @
  7. //憪靘憓摰冽# S- o. @- N% k* U6 R- L1 S4 A
  8. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  
    3 x- R' T+ ^# N$ ?
  9. //雿輻皂crypt_encrypt賣詨撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪
    8 X, B& ]& \/ m
  10. $encrypted_toencrypt = mcrypt_encrypt($encryptMethod, $key, $toencrypt, MCRYPT_MODE_ECB,$iv);   ; L. E% A3 C- m( [9 O' {3 F0 }5 H5 b
  11. //唾圾撖敺摮銝+ |6 y$ C. H) W6 y, r! j% v) r" A
  12. return base64_encode($encrypted_toencrypt);  
    , w, z0 A' q9 p+ Z
  13. }  
      y, T4 Q# j, A# Y7 U) b
  14. //閫撖賣豢啣神
    8 @: p: w: k# g2 {2 B
  15. function decrypt($source,$todecrypt) {  
    0 \+ z! e9 h1 T7 _$ z
  16. //閫撖函key嚗敹頝撖函key銝璅   
    * }7 H* u- v0 B5 [
  17. $key = $source;  
    + l! a5 k. x; |; t) T
  18. //閫撖閫base64蝣
    9 J1 H/ l1 j" Z! h
  19. $todecrypt = base64_decode($todecrypt);& @7 n. u  ^& I% l) g
  20. //雿輻3DES寞閫撖
    5 U1 A# A8 F' I3 ^( M
  21. $encryptMethod = MCRYPT_TRIPLEDES;  7 q% f8 J' n! c; W* n+ K' h- j
  22. //憪靘憓摰冽
    ! q1 k; P+ u- P! G' v: `
  23. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  # a4 G+ P; }4 C: P( n
  24. //雿輻皂crypt_decrypt賣貉圾撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪  
    / P3 F) g4 q# R% H8 _4 U: u& F
  25. $decrypted_todecrypt = mcrypt_decrypt($encryptMethod, $key, $todecrypt, MCRYPT_MODE_ECB,$iv);
    + A$ o. u- t) d) l0 H4 N) \7 @
  26. //唾圾撖敺摮銝# M4 P& t2 B- h  Z, D+ ~
  27. return $decrypted_todecrypt;  3 N; S; ^# Z$ J( ?/ x
  28. }  ; L0 Z  k0 Q1 J# l
  29. //撖怠末閫撖賣訾敺嚗撠勗臭誑靘脰皜祈岫鈭
    9 `' K" B! p# U9 @2 S  b' S: ^
  30. //key閮剖" G% B/ u% M- |- l6 x4 p2 Q& Z+ j
  31. $source ="1234567890";
    ( ^* H) G# d8 l
  32. //閬撖摮銝8 r8 \& U, ]+ d( X# w- s
  33. $string ="www.av4u.co";
    7 \5 ~2 B) D( O8 ^& U1 ]
  34. echo "string=".$string."<br>";
    ; S% D- Z. j3 q0 ~0 e* n- R) ^* U
  35. //脰撖銝阡*蝷箏撖敺摮銝
    " R% Y- H9 K- K1 C& C4 L# ^
  36. $encode = encrypt($source,$string);7 j1 M# a7 i2 p. s, n
  37. echo "encode=".$encode."<br>";/ ~1 B! ]$ b5 Z3 `- N7 ^4 J1 A/ M
  38. //脰閫撖銝阡*蝷箄圾撖敺摮銝' ?; |" Q" T) I7 R' j, P+ i
  39. $decode = decrypt($source,$encode);# w* o( U+ R* O
  40. echo "decode=".$decode."<br>";
銴鋆賭誨蝣

# X& ~9 ?9 h, |. g
蝯憒銝:
' y1 u4 W+ y" X$ W1 |. `1 V
( |/ J: _" Z4 H1 D+ {* |
瘜冽:
      憒閫撖蝔瘝雿輻灸ase64蝣潛閰梧頝函雯鞈唾撓嚗交嗥垢⊥閫霈(臬撖敺鞈唾撓航炊嚗雿臬典銝蝬脩抒閫撖舀憿)嚗蝯憒銝:
2 H. V( B! J) O2 F; Y, e( O

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-11-21 20:14 , Processed in 0.064228 second(s), 19 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵