52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-11 21:02:57 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 IT_man 2014-12-11 22:31 蝺刻摩 9 d4 K( k. `; G, i9 s8 F0 }

. N  D3 Q. u" _/ |
望潭蝬脩摮撖閬,閬銴撖瞍蝞瘜嚗甇日豢3DES撖
3DES撖(Triple DES)嚗臭撖瞍蝞瘜蝔梧3DES望蝔格芋撘嚗銝V蝝寧浩CB璅∪撖急
擐瑼X召inux臬行摰鋆mcrypt璅∠嚗寞憒銝:
- _! ?6 X: C. r6 q+ r
  1. rpm -qa | grep php-mcrypt
銴鋆賭誨蝣

: H8 w; x( X* C$ u5 b; ^* `其蝬脩撱箔php瑼嚗憒phpinfo.php(批捆憒銝)亦臬行mcrypt module
( H) v" m, ]: M0 U8 G+ W! q
  1. <?php( o, k! U# g& @6 y, L
  2. // Show all information, defaults to INFO_ALL& T; s9 ~+ h. z
  3. phpinfo();
    5 O; a, c) \" G3 \9 M% O3 T
  4. ?>
銴鋆賭誨蝣

7 g, `+ n$ s7 E嗅嬌rowser 瑁phpinfo.php嚗蝯憒銝:
; p  R7 c: {. W3 A" x/ ]% o
, M. V: o+ l& Q  f4 i* G" }9 f

5 A' E0 j" p, f
憒瘝摰鋆php-mcrypt嚗脰摰鋆(摰鋆寞)嚗摰鋆摰敺隞乩餈啣拍車寞銝隞交炎乓
銋敺撠勗臭誑啣神撖蝔撘憒銝嚗

" w5 k) M1 C5 b/ r
  1. //撖賣豢啣神7 ^, a) y) |* [1 u, z; G2 S8 b
  2. function encrypt($source,$toencrypt){  
    - a6 a% B6 S' S0 T& k4 |
  3. //撖函key     e0 v6 ]" s  V8 f2 n
  4. $key = $source;  
    ; N' J$ W' W7 {
  5. //雿輻3DES寞撖   1 |4 m: ^& F1 k$ [7 `! [6 W9 G
  6. $encryptMethod = MCRYPT_TRIPLEDES; 3 F& x. l6 L! v4 C: g
  7. //憪靘憓摰冽# f; w4 s2 r9 `9 L' b
  8. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  
    5 ?1 u, R' h, t& M: Y
  9. //雿輻皂crypt_encrypt賣詨撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪  z( V6 T) E: d8 b9 I
  10. $encrypted_toencrypt = mcrypt_encrypt($encryptMethod, $key, $toencrypt, MCRYPT_MODE_ECB,$iv);     [: t- e) ?! R+ z" p* c: V
  11. //唾圾撖敺摮銝7 ]3 _9 ^& V& B" L+ h
  12. return base64_encode($encrypted_toencrypt);  
    - l8 l' T2 ]6 w# m
  13. }  * d9 }2 ^( O/ T9 k% q, h6 X
  14. //閫撖賣豢啣神4 R. W0 m, J, C  ]; r+ F7 z( O
  15. function decrypt($source,$todecrypt) {  
    ( m( D4 N1 ?( x; n8 r+ Y$ a" R
  16. //閫撖函key嚗敹頝撖函key銝璅   , n  i7 u- |' D2 w
  17. $key = $source;  
    / @+ T. P7 R/ Q  Z# F0 r
  18. //閫撖閫base64蝣! ~; z" }* J! @3 U  e
  19. $todecrypt = base64_decode($todecrypt);
    0 P  I8 [0 n4 r+ \, F+ B+ W1 H
  20. //雿輻3DES寞閫撖7 `0 R* a. ^- |' I9 B: [+ ^
  21. $encryptMethod = MCRYPT_TRIPLEDES;  
    + l- H* _! q8 t$ _
  22. //憪靘憓摰冽
    * M( ^& ?& d! p2 I+ Q
  23. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  
    7 I* T8 D8 v3 F" Q. v) f4 x
  24. //雿輻皂crypt_decrypt賣貉圾撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪  
    / @& P/ t# {) B; b: j6 x9 H) K4 N
  25. $decrypted_todecrypt = mcrypt_decrypt($encryptMethod, $key, $todecrypt, MCRYPT_MODE_ECB,$iv);
    # p9 s% @* }" @& J0 D+ F: I
  26. //唾圾撖敺摮銝
    3 `  r1 k) S8 F: ?7 R) X
  27. return $decrypted_todecrypt;  
      w7 A: h. P; ?6 h$ P+ ~% X
  28. }  4 n! Z- W0 |  |- L, P6 Z2 y
  29. //撖怠末閫撖賣訾敺嚗撠勗臭誑靘脰皜祈岫鈭
    ' z( J# E/ |7 w4 ^% ^
  30. //key閮剖  A5 D0 R9 T. r
  31. $source ="1234567890";! G7 X/ |: h, [, e; p# w" g! Y
  32. //閬撖摮銝" c( {  F( v) C; |
  33. $string ="www.av4u.co";
      x* K4 j, Q3 p, \! X& |
  34. echo "string=".$string."<br>";& H0 f' ?: Y: s+ j6 }7 p( k8 h
  35. //脰撖銝阡*蝷箏撖敺摮銝
    & s( d) _, L* D3 k" X' c0 m* l
  36. $encode = encrypt($source,$string);
    5 t8 [  g+ I' j; V
  37. echo "encode=".$encode."<br>";
    : D0 N6 E* ]* ~) d7 [& \* g. ~3 d
  38. //脰閫撖銝阡*蝷箄圾撖敺摮銝
    ! o; r. ?* g/ a" x
  39. $decode = decrypt($source,$encode);" w$ O, I' k& g8 o
  40. echo "decode=".$decode."<br>";
銴鋆賭誨蝣

; {  |6 q# |& f* r) n
蝯憒銝:

7 V5 g) @  H) O

* x, V9 A; z  D' c; Z9 r% t8 A
瘜冽:
      憒閫撖蝔瘝雿輻灸ase64蝣潛閰梧頝函雯鞈唾撓嚗交嗥垢⊥閫霈(臬撖敺鞈唾撓航炊嚗雿臬典銝蝬脩抒閫撖舀憿)嚗蝯憒銝:
2 e  R, B# c  h  b

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-12-22 17:37 , Processed in 0.064485 second(s), 19 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵