Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: why use Encrypted Packet?  (Read 2656 times)

0 Members and 1 Guest are viewing this topic.

Fantasy

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
why use Encrypted Packet?
« on: September 10, 2011, 12:34:57 am »
Hello everyone

I was just wondering what is the point of using Encrypted Packets ? I read about it in the SFML network tutorial and i really didnt understand it very well.

http://www.sfml-dev.org/tutorials/1.6/network-packets.php

is there any point to it ?
i though it would be just easier to just write a struct and send it.

thanks.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: why use Encrypted Packet?
« Reply #1 on: September 10, 2011, 09:18:46 am »
Quote from: "Fantasy"
is there any point to it ?

There are two answers :

if you're asking "is there any point to use EncryptedPacket class" then the answer is no. The implementation of the encryption algorithm is only an example and shouldn't be used to transmit "secured" data. In fact the example could have been something else like ZippedPacket for example. It's only purpose here is to show you how to subclass sf::Packet.

if you're asking "is there any point to use a custom packet to encrypt/compress/whatever my data" then the answer will differ from one scenario case to another one. It really depends on what your data are and if you really need them to be encrypted/compressed/whatever in your application.

Anyway, if you really need encryption for you data then you should not build you own encryption system (it's very very ... very hard to make a good one). Instead use something that already exists like ssl connection. There are some good libraries out there.

EDIT : I might have misunderstood your question..
Quote
i though it would be just easier to just write a struct and send it.

Yes. The tutorial explains that too. See §Packets and custom classes.
SFML / OS X developer