La théorie de la structure des systÚmes cachés

introduction

À partir de la cryptographie classique, de sa crĂ©ation Ă  sa renaissance dans la cryptographie moderne, il y a toujours eu un problĂšme de transfert d'une clĂ© de cryptage entre sujets. Le problĂšme a Ă©tĂ© partiellement rĂ©solu dans la seconde moitiĂ© du XXe siĂšcle, avec l'Ă©mergence d'une section asymĂ©trique de la cryptographie, lorsqu'une attaque d'Ă©coute est devenue impossible [1]. NĂ©anmoins, le problĂšme originel demeure et est encore exploitĂ© Ă  ce jour, quoique sous une forme voilĂ©e.





L'obstacle qui est devenu sur la solution du problĂšme rĂ©side dans l'Ă©lĂ©ment de confiance, en sa prĂ©sence et en son absence. Si vous ne prenez aucune mesure pour Ă©tablir des connexions de confiance, alors toutes les connexions feront a priori l'objet d'attaques MITM (man in the middle). D'un autre cĂŽtĂ©, si vous Ă©tablissez des connexions de confiance, la possibilitĂ© d'attaques MITM ne disparaĂźt pas, mais diminue. Et maintenant, avec les sujets originaux, il y a des sujets intermĂ©diaires, interstitiels (serveurs, nƓuds pour stocker et transmettre des informations), choisis par nous, et sont des attaquants lĂ©galement Ă©tablis. Ce n'est qu'en limitant la portĂ©e d'attaque qu'ils n'arrĂȘtent pas d'attaquer potentiellement. Ces nƓuds connaissent toutes les informations transmises par nous et Ă  nous: passe-temps, intĂ©rĂȘts, passe-temps, divertissement, messages. De plus, cette information (objet), comme cela arrive souvent,commence Ă  se convertir en publicitĂ©, sur la base de laquelle le capital de toutes les mĂȘmes entitĂ©s intermĂ©diaires augmente. En consĂ©quence, tout le problĂšme est complĂštement bouleversĂ©, et maintenant, au lieu de chercher une connexion pour l'Ă©coute clandestine, l'attaquant la crĂ©e lui-mĂȘme, il devient lui-mĂȘme le fondement de l'Ă©coute sous l'apparence d'un serveur, et les gens, Ă  leur tour , ne choisissez que le visage de celui qui est derriĂšre ils seront surveillĂ©s de prĂšs.





Il n'est pas possible de dĂ©truire un tel systĂšme de confiance en raison de l'Ă©mergence de types d'attaques plus gĂ©nĂ©raux et destructeurs, ainsi qu'en raison de l'impossibilitĂ© d'Ă©radiquer complĂštement la confiance en tant que telle [2, p.267]. Ainsi, il ne reste plus qu'Ă  amĂ©liorer ce systĂšme, Ă  faire en sorte que son mĂ©canisme lui-mĂȘme tende Ă  rĂ©duire le pouvoir de confiance *, de sorte que sa propre structure reprĂ©senterait la protection des objets et des sujets anonymes. Les systĂšmes de ce type comprennent des rĂ©seaux anonymes et des canaux de communication secrets.





Le pouvoir de la confiance

* — , , . , , , , , . , , , . . , - . , , , , . , (-, ), , .





, , – , . , , – , , , . /, . , .





, , (, ). , , , . , .





, , . ( - ) , , . , . , . , , , , .





, , . , . : , . “ ” ( ), - . , . “ ” ( ), . , “” , (-) .





, . , , / . , . , / , , , , . , .





- , , , , . (2,3,4,5,6 ).





  1. |A| = 0*. .





  2. -, -. , (, IP-, , ). . , , , , - . , , |A| = 1. -.





  3. , , - . , , , lim|A|→C, C - - . , . , ( ) - , - , .





  4. . , , , , , . , , ( ) . , , , [3] .., ( , ). , , , , , , - , [4, .398]. , , , . , ( ) () () . , - 0 < |A| ≀ N, N - . , , , .





  5. , , . . , lim|A|→C, C - . , Tor ( ), I2P ( ) ..





  6. , , , ( ) . , , . 0 < |A| ≀ N(C+1), N - , C - . , , . , , , .





, , , , , , - .





, , , [5, .223]. , , , , , . , . , , . , .





, , ( ), , , ( ). , , ( , ) . , , . , , , , , (lim|A|→1) . , , , , . , , . , . , . , . , , . :





  1. . , . , , , , , . -- ( friend-to-friend), — . , , , . , , - , - . , , , , , , . friend-to-friend (f2f) , , , .





  2. — . , , , () / (). , - , , . , . O(N) . , , N , N-1 . (TTL) , , , , .





, , , . , . , , , , , . , . , , :





  1. — , . , . , . , , , .





  2. . , - . , , A B, A**. Tor, , “”, .





. , , . , . , , , . , . , . , , , — , “” . , , . , , - -.





[6]
import (
	"bytes"
)
func RoutePackage(sender *PrivateKey, receiver *PublicKey, data []byte, route []*PublicKey) *Package { 
  var ( 
    rpack = Encrypt(sender, receiver, data) 
    psender = GenerateKey(N) 
  ) 
  for _, pub := range route { 
    rpack = Encrypt( 
      psender, 
      pub, 
      bytes.Join(
        [][]byte{
          ROUTE_MODE, 
          SerializePackage(rpack),
        },
        []byte{},
      ),
    )
  } 
  return rpack 
}
      
      



, {A, B, C} ( — A) , , ( , ). , , , , , . , , , : (A → B A → C) → (B → C C → B) → (B → A C → A), , : (A → B A → C) → (B → A C → A)***. , (), . , ( , ), ( , ). , , , , , : (1) - (1) - (2) (1) - (1) - (1). , ( ), (2) (2), . , ( ) k n ( n = 2), (k, 2) = 2 ( — ), , k = 2, : (A → B A → C) → (B → C C → B) → (B → C C → B) → (B → A C → A). , : (1) - (1) - (2) - (2) (1) - (1) - (~1) - (1), . , (1) = (1), (2) = (1), (2) = (~1). (1), , . - , . , (3) = (2), .





, , , , . , , - , - , - - . , . , :





  1. . , , . , . , , .





  2. . , , , , , . , .





, , , , ( ). T, (2+k, 2) ( - ), , k = 2 4. , , , ( ). , , , , . :





  1. k ( , ).





  2. k [1;n], n < N ( ).





* — , , , . , ( ). , ( ).





** — , , . , , . .





*** , , , .





, , - , , , . , , , , - . , :





  1. , , - , / [7] . , , (, ), (). (), .





  2. , , , , . , , . , . , , , . ( |A| = 1), . , , . , , , , . - — ( ).





, , , . , , , . , , , , . , -, -, , , . , . , ( , ) 2MiB, 256KiB.





, , . , , , . , , (, ..), , . , , , . , , .





, , , . , , . , ( , , ), , .





, , , , , [8, .720]. , , , , , . , , , . , - , .





, , ( ), , ( ), ( ) ( , ).





, , , , . [2, .58][8, .80].





. , , , , , .





, . , , . . . .





, , , , , , - , . , , ( , ) .





import ( 
  "bytes" 
  "encoding/hex" 
) 
func Encrypt(sender *PrivateKey, receiver *PublicKey, data []byte) *Package { 
  var ( 
    session = GenerateBytes(N) 
    rand = GenerateBytes(M) 
    pubsend = PublicKeyToBytes(&sender.PublicKey) 
    hash = HashSum(bytes.Join( 
      [][]byte{ 
        rand, 
        data,pubsend, 
        PublicKeyToBytes(receiver), 
      }, 
      []byte{}, 
    )) 
    sign = Sign(sender, hash) 
  ) 
  return &Package{ 
    Head: HeadPackage{ 
      Rand: hex.EncodeToString(EncryptS(session, rand)), 
      Sender: hex.EncodeToString(EncryptS(session, pubsend)), 
      Session: hex.EncodeToString(EncryptA(receiver, session)), 
    }, Body: BodyPackage{ 
      Data: hex.EncodeToString(EncryptS(session, data)), 
      Hash: hex.EncodeToString(hash), 
      Sign: hex.EncodeToString(EncryptS(session, sign)), 
      Npow: ProofOfWork(hash, C), 
    }, 
  } 
}
      
      



, , ( ) . , .





() , , , .





import ( 
  "bytes" 
  "encoding/hex" 
) 
func Decrypt(receiver *PrivateKey, pack *Package) (*PublicKey, []byte) { 
  // Check proof. 
  hash, err := hex.DecodeString(pack.Body.Hash) 
  if err != nil { 
    return nil, nil 
  } 
  if !ProofIsValid(hash, C, pack.Body.Npow) { 
    return nil, nil 
  } 
  // Decrypt session key. 
  eskey, err := hex.DecodeString(pack.Head.Session) 
  if err != nil { 
    return nil, nil 
  } 
  skey := DecryptA(receiver, eskey) 
  if skey == nil { 
    return nil, nil 
  } 
  // Decrypt public key.
  ebpubsend, err := hex.DecodeString(pack.Head.Sender) 
  if err != nil { 
    return nil, nil 
  } 
  bpubsend := DecryptS(skey, ebpubsend) 
  if bpubsend == nil { 
    return nil, nil 
  } 
  pubsend := BytesToPublicKey(bpubsend) 
  if pubsend == nil { 
    return nil, nil 
  } 
  // Decrypt and check sign. 
  esign, err := hex.DecodeString(pack.Body.Sign) 
  if err != nil { 
    return nil, nil 
  } 
  sign := DecryptS(skey, esign) 
  if sign == nil { 
    return nil, nil 
  } 
  if !Verify(pubsend, hash, sign) { 
    return nil, nil 
  } 
  // Decrypt rand. 
  erand, err := hex.DecodeString(pack.Head.Rand) 
  if err != nil { 
    return nil, nil 
  }
  rand := DecryptS(skey, erand) 
  if rand == nil { 
    return nil, nil 
  } 
  // Decrypt data. 
  edata, err := hex.DecodeString(pack.Body.Data) 
  if err != nil { 
    return nil, nil 
  } 
  data := DecryptS(skey, edata) 
  if data == nil { 
    return nil, nil 
  } 
  // Check hash. 
  check := HashSum(bytes.Join( 
    [][]byte{ 
      rand, 
      data, 
      PublicKeyToBytes(pubsend), 
      PublicKeyToBytes(&receiver.PublicKey), 
    }, 
    []byte{}, 
  )) 
  if !bytes.Equal(hash, check) { 
    return nil, nil 
  } 
  return pubsend, data 
}
      
      



, , , , ( ), n- , i- . , ⎡M/nN⎀+1 , M - , N - . , , .





gopeer: https://github.com/Number571/gopeer





- HES, : https://github.com/Number571/HES





, ( , ), , ( ) ( ). , . . , , . , , (, ), (, ) ( , ). ( ), .





  1. . ., . . [ ]. — : https://ee.stanford.edu/~hellman/publications/24.pdf ( : 19.12.2020).





  2. , ., , . . / . , . . . - .: «, 2005. - 420 .





  3. , . : [ ]. — : https://bitcoin.org/files/bitcoin-paper/bitcoin_ru.pdf ( : 19.12.2020).





  4. , ., , . / . , . . — .: , 2017. - 960 .





  5. , . ., , . . / . . , . . . - .: - , 2019. - 300 .





  6. Donovan, A.A., Kernighan, B.U. Aller au langage de programmation / A.A. Donovan, B.U. Kernighan. - M.: OOO "I.D. Williams ", 2018. - 432 p.





  7. Shelukhin, O. I., Kanaev, S. D. Stéganographie. Algorithmes et implémentation logicielle / O.I. Shelukhin, S.D. Kanaev. - M .: Hotline - Telecom, 2018 - 592 p.





  8. Schneier, B. Cryptographie appliquée. Protocoles, algorithmes et codes sources en C / B. Schneier. - SPB.: OOO "Alfa-kniga", 2018. - 1040 p.








All Articles