sockscape/server/src/main.cpp

46 lines
1.1 KiB
C++
Raw Normal View History

2018-02-14 01:16:58 +00:00
#include <iostream>
2018-02-28 23:07:39 +00:00
#include <string>
2018-02-15 23:09:09 +00:00
#include "sock/tcpsock.hpp"
2018-02-28 23:07:39 +00:00
#include "utils/string.hpp"
2018-03-01 23:16:47 +00:00
#include "utils/net.hpp"
2018-03-05 23:23:07 +00:00
#include "utils/time.hpp"
2018-03-07 23:07:28 +00:00
#include "sock/tcpsock.hpp"
2018-03-15 04:01:24 +00:00
#include "crypto/sha1.hpp"
2018-03-15 22:02:10 +00:00
#include "crypto/base64.hpp"
2018-03-20 22:42:26 +00:00
#include "crypto/bfish.hpp"
#include "utils/csprng.hpp"
2018-02-14 01:16:58 +00:00
int main(int argc, char **argv) {
2018-02-16 22:34:22 +00:00
//auto sock = sosc::TcpClient();
2018-03-01 23:16:47 +00:00
/*std::string a = "this!!is!!a!!test";
2018-02-28 23:07:39 +00:00
auto b = sosc::str::split(a, "!!");
std::for_each(b.begin(), b.end(), [](std::string& i) {
std::cout << i << std::endl;
2018-03-01 23:16:47 +00:00
});*/
2018-03-08 04:27:54 +00:00
/*sosc::TcpClient client;
client.Open("127.0.0.1", 1111);
2018-03-01 23:16:47 +00:00
2018-03-07 23:07:28 +00:00
client.Send("test");
2018-03-08 04:27:54 +00:00
std::string got = "abc";
2018-03-07 23:07:28 +00:00
while(client.IsOpen()) {
2018-03-08 04:27:54 +00:00
int length = client.Receive(&got);
2018-03-07 23:07:28 +00:00
if(length > 0)
std::cout << got << std::endl;
2018-03-08 04:27:54 +00:00
}*/
2018-02-15 23:09:09 +00:00
2018-03-15 22:02:10 +00:00
//std::string a = sosc::cgc::sha1("test", true);
2018-03-20 22:42:26 +00:00
sosc::cgc::Blowfish fish("");
std::string test = fish.Encrypt("imagine a test");
std::string testd = fish.Decrypt(test);
uint32_t teest = sosc::csprng::next<uint32_t>();
2018-02-14 01:16:58 +00:00
return 0;
}