Jump to content

Nytro

Administrators
  • Posts

    18725
  • Joined

  • Last visited

  • Days Won

    706

Everything posted by Nytro

  1. Nytro

    Polonic is back

    Pai fa si tu ceva, ca ne cam plictisim. Canta-te ceva. Pune pe youtube, sa mai radem si noi
  2. Nytro

    Polonic is back

    Ai devenit plictisitoare fa
  3. Si... Cum a ajuns acolo?
  4. Nytro

    Vand iphone 5

    Cel mai bun iPhone: Telefon mobil Samsung I9300 GALAXY S3, 32GB, Blue I9300 Galaxy S3 32GB Blue - eMAG.ro
  5. MD5 Message Digest Algorithm Overview [TABLE] [TR] [TD]© 2011 by Dr. Herong Yang. All rights reserved. This section describes the MD5 algorithm - a 5-step process of padding of '1000...', appending message length, dividing as 512-bit blocks, initializing 4 buffers, and 4-round of hashing each block MD5 algorithm is well described in RFC 1321 - The MD5 Message-Digest Algorithm, see http://www.ietf.org/rfc/rfc1321.txt. Below is a quick overview of the algorithm. [/TD] [TD][/TD] [/TR] [/TABLE] MD5 algorithm consists of 5 steps: Step 1. Appending Padding Bits. The original message is "padded" (extended) so that its length (in bits) is congruent to 448, modulo 512. The padding rules are: The original message is always padded with one bit "1" first. Then zero or more bits "0" are padded to bring the length of the message up to 64 bits fewer than a multiple of 512. Step 2. Appending Length. 64 bits are appended to the end of the padded message to indicate the length of the original message in bytes. The rules of appending length are: The length of the original message in bytes is converted to its binary format of 64 bits. If overflow happens, only the low-order 64 bits are used. Break the 64-bit length into 2 words (32 bits each). The low-order word is appended first and followed by the high-order word. Step 3. Initializing MD Buffer. MD5 algorithm requires a 128-bit buffer with a specific initial value. The rules of initializing buffer are: The buffer is divided into 4 words (32 bits each), named as A, B, C, and D. Word A is initialized to: 0x67452301. Word B is initialized to: 0xEFCDAB89. Word C is initialized to: 0x98BADCFE. Word D is initialized to: 0x10325476. Step 4. Processing Message in 512-bit Blocks. This is the main step of MD 5 algorithm, which loops through the padded and appended message in blocks of 512 bits each. For each input block, 4 rounds of operations are performed with 16 operations in each round. This step can be described in the following pseudo code slightly modified from the RFC 1321's version: Input and predefined functions: A, B, C, D: initialized buffer words F(X,Y,Z) = (X AND Y ) OR (NOT X AND Z) G(X,Y,Z) = (X AND Z ) OR (Y AND NOT Z) H(X,Y,Z) = X XOR Y XOR Z I(X,Y,Z) = Y XOR (X OR NOT Z) T[1, 2, ..., 64]: Array of special constants (32-bit integers) as: T[i] = int(abs(sin(i)) * 2**32) M[1, 2, ..., N]: Blocks of the padded and appended message R1(a,b,c,d,X,s,i): Round 1 operation defined as: a = b + ((a + F(b,c,d) + X + T[i]) <<< s) R2(a,b,c,d,X,s,i): Round 1 operation defined as: a = b + ((a + G(b,c,d) + X + T[i]) <<< s) R3(a,b,c,d,X,s,i): Round 1 operation defined as: a = b + ((a + H(b,c,d) + X + T[i]) <<< s) R4(a,b,c,d,X,s,i): Round 1 operation defined as: a = b + ((a + I(b,c,d) + X + T[i]) <<< s) Algorithm: For k = 1 to N do the following AA = A BB = B CC = C DD = D (X[0], X[1], ..., X[15]) = M[k] /* Divide M[k] into 16 words */ /* Round 1. Do 16 operations. */ R1(A,B,C,D,X[ 0], 7, 1) R1(D,A,B,C,X[ 1],12, 2) R1(C,D,A,B,X[ 2],17, 3) R1(B,C,D,A,X[ 3],22, 4) R1(A,B,C,D,X[ 4], 7, 5) R1(D,A,B,C,X[ 5],12, 6) R1(C,D,A,B,X[ 6],17, 7) R1(B,C,D,A,X[ 7],22, 8) R1(A,B,C,D,X[ 8], 7, 9) R1(D,A,B,C,X[ 9],12,10) R1(C,D,A,B,X[10],17,11) R1(B,C,D,A,X[11],22,12) R1(A,B,C,D,X[12], 7,13) R1(D,A,B,C,X[13],12,14) R1(C,D,A,B,X[14],17,15) R1(B,C,D,A,X[15],22,16) /* Round 2. Do 16 operations. */ R2(A,B,C,D,X[ 1], 5,17) R2(D,A,B,C,X[ 6], 9,18) R2(C,D,A,B,X[11],14,19) R2(B,C,D,A,X[ 0],20,20) R2(A,B,C,D,X[ 5], 5,21) R2(D,A,B,C,X[10], 9,22) R2(C,D,A,B,X[15],14,23) R2(B,C,D,A,X[ 4],20,24) R2(A,B,C,D,X[ 9], 5,25) R2(D,A,B,C,X[14], 9,26) R2(C,D,A,B,X[ 3],14,27) R2(B,C,D,A,X[ 8],20,28) R2(A,B,C,D,X[13], 5,29) R2(D,A,B,C,X[ 2], 9,30) R2(C,D,A,B,X[ 7],14,31) R2(B,C,D,A,X[12],20,32) /* Round 3. Do 16 operations. */ R3(A,B,C,D,X[ 5], 4,33) R3(D,A,B,C,X[ 8],11,34) R3(C,D,A,B,X[11],16,35) R3(B,C,D,A,X[14],23,36) R3(A,B,C,D,X[ 1], 4,37) R3(D,A,B,C,X[ 4],11,38) R3(C,D,A,B,X[ 7],16,39) R3(B,C,D,A,X[10],23,40) R3(A,B,C,D,X[13], 4,41) R3(D,A,B,C,X[ 0],11,42) R3(C,D,A,B,X[ 3],16,43) R3(B,C,D,A,X[ 6],23,44) R3(A,B,C,D,X[ 9], 4,45) R3(D,A,B,C,X[12],11,46) R3(C,D,A,B,X[15],16,47) R3(B,C,D,A,X[ 2],23,48) /* Round 4. Do 16 operations. */ R4(A,B,C,D,X[ 0], 6,49) R4(D,A,B,C,X[ 7],10,50) R4(C,D,A,B,X[14],15,51) R4(B,C,D,A,X[ 5],21,52) R4(A,B,C,D,X[12], 6,53) R4(D,A,B,C,X[ 3],10,54) R4(C,D,A,B,X[10],15,55) R4(B,C,D,A,X[ 1],21,56) R4(A,B,C,D,X[ 8], 6,57) R4(D,A,B,C,X[15],10,58) R4(C,D,A,B,X[ 6],15,59) R4(B,C,D,A,X[13],21,60) R4(A,B,C,D,X[ 4], 6,61) R4(D,A,B,C,X[11],10,62) R4(C,D,A,B,X[ 2],15,63) R4(B,C,D,A,X[ 9],21,64) A = A + AA B = B + BB C = C + CC D = D + DD End of for loop Output: A, B, C, D: Message digest Step 5. Output. The contents in buffer words A, B, C, D are returned in sequence with low-order byte first. Din aceeasi serie: ?MD5 Mesasge Digest Algorithm What Is MD5 Message Digest Algorithm? ?MD5 Message Digest Algorithm Overview Using MD5 Message Digest in Java Using MD5 Message Digest in PHP Using MD5 Message Digest in Perl Sursa: MD5 Message Digest Algorithm Overview Simplu si la obiect.
  6. [h=1]OpenSSL, RSA, AES, and C++[/h] In my seemingly endless side project to implement RSA and AES encryption to my Alsa Server project, I wrote a while ago about doing simple RSA encryption with OpenSSL. Now, I’m here to say that I was doing it all wrong. In my first post about RSA encryption and OpenSSL my code was using the low level RSA functions when I should have been using the high level EVP (envelope) functions, which are much nicer to work with once you get the hang of them. Being that this code is eventually going to be merged in my Alsa server project, I went ahead and also implemented AES encryption/decryption and put everything in an easy to use C++ class. I assume that readers are familiar with encryption and OpenSSL terminology (things like IV, key lengths, public vs private keys, etc.). If not, look it up since there are much better explanations out there so why reinvent the wheel by explaining them here? Moving on. First up, since all the code presented is in various functions from a class (full listing is at the end), let’s look at the class members, and constructors first to understand where some of these variables are coming from. Below are all the class members. I know, not exactly intuitive, but bear with me. Header: #include <openssl/evp.h> #include <openssl/pem.h> #include <openssl/aes.h> #include <openssl/err.h> #include <stdio.h> #include <string> #include <string.h> #define DEBUG #ifdef DEBUG #define DEFAULT_RSA_KEYLEN 1024 #define DEFAULT_AES_KEYLEN 128 #define AES_ROUNDS 3 #else #define DEFAULT_RSA_KEYLEN 2048 #define DEFAULT_AES_KEYLEN 256 #define AES_ROUNDS 6 #endif #define PSUEDO_CLIENT #define SALT "alsa_channel_control" #define AES_KEY_PASS "alsa_channel_control" #define SUCCESS 0 #define FAILURE -1 #define KEY_SERVER_PRI 0 #define KEY_SERVER_PUB 1 #define KEY_CLIENT_PUB 2 class ServerCrypto { public: ServerCrypto(); ServerCrypto(unsigned char *clientPubKey, size_t clientPubKeyLen); ServerCrypto(unsigned char *clientPubKey, size_t clientPubKeyLen, size_t rsaKeyLen, size_t aesKeyLen); ~ServerCrypto(); int rsaEncrypt(std::string msg, unsigned char **encMsg); int rsaEncrypt(const char *msg, size_t msgLen, unsigned char **encMsg); int aesEncrypt(std::string msg, unsigned char **encMsg); int aesEncrypt(const char *msg, size_t msgLen, unsigned char **encMsg); std::string rsaDecrypt(unsigned char *encMsg, size_t encMsgLen); int rsaDecrypt(unsigned char *encMsg, size_t encMsgLen, char **decMsg); std::string aesDecrypt(unsigned char *encMsg, size_t encMsgLen); int aesDecrypt(unsigned char *encMsg, size_t encMsgLen, char **decMsg); int writeKeyToFile(FILE *fd, int key); int setClientPubKey(unsigned char* pubKey, size_t pubKeyLen); unsigned char* getServerPubKey(); unsigned char* getServerPriKey(); unsigned char* getServerAESKey(); private: EVP_PKEY *serverKeypair; EVP_PKEY *clientPubKey; EVP_CIPHER_CTX *rsaEncryptCtx; EVP_CIPHER_CTX *aesEncryptCtx; EVP_CIPHER_CTX *rsaDecryptCtx; EVP_CIPHER_CTX *aesDecryptCtx; unsigned char *rsaSymKey; int rsaSymKeyLen; unsigned char *rsaIV; unsigned char *aesKey; unsigned char *aesIV; size_t encryptLen; int init(size_t rsaKeyLen, size_t aesKeyLen); int genTestClientKey(int keyLen); }; Articol complet: http://shanetully.com/2012/06/openssl-rsa-aes-and-c-oh-my/
  7. Nu arata rau deloc.
  8. Mda, "banal": "Our bootloader"... Shit just got more serious.
  9. Defeating PatchGuard Bypassing Kernel Security Patch Protection in Microsoft Windows By Deepak Gupta, McAfee Labs, and Xiaoning Li, Intel Labs Table of Contents Summary 3 Introduction 3 Kernel Patching 4 PatchGuard 5 Initialization and operations 5 Initialization 6 Operations 6 Attacks and countermeasures 7 Exception handler hooking 7 Hooking KeBugCheckEx 8 Debug register attack with general detect bit on 8 Translation cache attack 11 Patching the kernel timer DPC dispatcher 11 A generic attack 12 A New Level of Security 18 Summary The kernel forms the core of any operating system. In conjunction with device drivers, the kernel abstracts interfaces for processes, memory management, file system, networking, and other services used by application developers. The kernel and other device drivers run at ring 0, the highest privilege, and form the bottom of the stack. Attacking the kernel and drivers puts an attacker in an advantageous position and helps hide footprints (rootkit activity). This stealth is required because most antimalware scanners update very frequently. If malware leaves behind footprints, then it can be traced, contained, and easily caught. Thus kernel-level malware with rootkit abilities are a very high-risk category. To protect the 64-bit Windows kernel, Microsoft created Kernel Patch Protection, commonly called PatchGuard. We haven’t seen many attacks on the 64-bit kernel barring some incidents of TDL4/Alureon and Xpaj. (These are actually “bootkit” attacks against the hard drive’s master boot record that can be prevented or cleaned later.) We know of no attack in the wild that targets PatchGuard and then patches the kernel image or critical kernel data structures. However, independent research, including our own, has proved that it is possible to defeat PatchGuard. These “white hat” attacks were published with proof of concept code and are purely for educational purposes. However, just as we have seen with earlier versions of Windows, malware developers will eventually find a way to crack the operating system’s defenses. Unlike 32-bit x86 processors, 64-bit processors from Intel come with virtualization extensions that can be used to set memory and CPU-register protections at the hardware level. DeepSAFE technology is one such offering from the collaborative efforts of Intel and McAfee; it will be instrumental in staying one step ahead of malware authors. Download: http://www.mcafee.com/us/resources/reports/rp-defeating-patchguard.pdf
  10. Cryptography Tutorials - Herong's Tutorial Examples Cryptography Tutorials - Herong's Tutorial Examples Copyright © 2011 by Dr. Herong Yang. All rights reserved. This cryptography tutorial book is a collection of notes and sample codes written by the author while he was learning cryptography technologies himself. Topics include blowfish, certificate, cipher, decryption, DES, digest, encryption, keytool, MD5, OpenSSL, PEM, PKCS#8, PKCS#12, private key, public key, RSA, secret key, SHA1, SSL, X.509. Table of Contents About This Book Cryptography Terminology Cryptography Basic Concepts What Is Cryptography? What Is Function? What Is Encryption? Introduction to DES Algorithm What Is Block Cipher? DES (Data Encryption Standard) Cipher Algorithm DES Key Schedule (Round Keys Generation) Algorithm DES Decryption Algorithm DES Algorithm - Illustrated with Java Programs DESSubkeysTest.java - DES Key Schedule Algorithm Illustration DES Key Schedule Algorithm Illustration Program Output DESCipherTest.java - DES Cipher Algorithm Illustration DES Cipher Algorithm Illustration Program Output DES Algorithm Java Implementation CipherDES.java - A Java Implementation of DES Java Implementation of DES - Test Cases DES Algorithm - Java Implementation in JDK JCE DES Java Implementation in JDK by Sun Steps of Using DES Algorithm in JDK JCE Testing DES Algorithm in JDK JCE What Is PKCS5Padding? JceSunDesPaddingTest.java - JCE DES Padding Test DES Encryption Operation Modes DES Encryption Operation Mode Introduction What is ECB (Electronic CodeBook) Operation Mode? What is CBC (Cipher Block Chaining) Operation Mode? What is CFB (Cipher FeedBack) Operation Mode? What is OFB (Output FeedBack) Operation Mode? DES Operation Modes in JCE JCE DES Operation Mode Testing Program JCE DES Operation Mode Testing Program Result DES in Stream Cipher Modes Introducting DES Stream Cipher Modes CFB (Cipher FeedBack) as a Stream Cipher OFB (Output FeedBack) as a Stream Cipher CFB and OFB Stream Ciphers Implemented in JCE JCE DES Stream Ciphers Testing Program JCE DES Stream Ciphers Testing Program Result PHP Implementation of DES - mcrypt mcrypt Library for PHP mcrypt Encryption Functions mcrypt DES Encryption Testing Program Block Padding in mcrypt Blowfish - 8-Byte Block Cipher What Is Block Cipher? Blowfish Cipher Algorithm Key Schedule (Sub-Keys Generation) Algorithm BlowfishJ - Java Implementation by Markus Hahn Blowfish Decryption Algorithm First 8366 Hex Digits of PI Secret Key Generation and Management javax.crypto.SecretKey - The Secret Key Interface javax.crypto.KeyGenerator - Generating Secret Keys Converting Secret Keys to and from Byte Arrays JceSecretKeyTest.java - Secret Key Test Program Cipher - Secret Key Encryption and Decryption javax.crypto.Cipher - The Secret Key Encryption Class JceSecretCipher.java - Secret Key Encryption Sample Program Blowfish Secret Key Encryption Tests Private key and Public Key Pair Generation Private and Public Keys and Related Interfaces KeyPair and KeyPairGenerator Classes Key Pair Sample Program - JcaKeyPair.java DSA Private Key and Public Key Pair Sample RSA Private Key and Public Key Pair Sample DiffieHellman Private Key and Public Key Pair Sample PKCS#8/X.509 Private/Public Encoding Standards What Is Key Encoding? PKCS#8 and X.509 Key Encoding Classes java.security.KeyFactory - Reading Encoded Keys JcaKeyFactoryTest.java - Key Factory Test Program Reading DSA Private and Public Key Files Reading RSA Private and Public Key Files Cipher - Public Key Encryption and Decryption javax.crypto.Cipher - The Public Key Encryption Class JcePublicCipher.java - Public Key Encryption Sample Program DSA Public Key Encryption Tests RSA Public Key Encryption Tests MD5 Mesasge Digest Algorithm What Is MD5 Message Digest Algorithm? MD5 Message Digest Algorithm Overview Using MD5 Message Digest in Java Using MD5 Message Digest in PHP Using MD5 Message Digest in Perl SHA1 Mesasge Digest Algorithm What Is SHA1 Message Digest Algorithm? SHA1 Message Digest Algorithm Overview Using SHA1 Message Digest in Java Using SHA1 Message Digest in PHP Using SHA1 Message Digest in Perl OpenSSL Introduction and Installation What Is OpenSSL? Installing OpenSSL on Windows OpenSSL Generating and Managing RSA Keys Generating New RSA Key Pairs Viewing Components of RSA Keys Encrypting RSA Keys OpenSSL Managing Certificates What Is a Certificate? Generating Self-Signed Certificates Viewing Components of Certificates OpenSSL Generating and Signing CSR Why Certificates Need to Be Signed by CA? Generating Certificate Signing Request (CSR) Viewing Components of Certificate Signing Request Signing a Certificate Signing Request OpenSSL Validating Certificate Path What Is a Certification Path? Certification Path Validation Rules Creating a Certificate Path with OpenSSL Validating a Certificate Path with OpenSSL "keytool" and "keystore" from JDK Certificates and Certificate Chains What Is "keystore"? "keytool" - Command Line Tool Generating Private Keys Exporting and Import Certificates Generating CSR (Certificate Signing Request) Cloning Certificates with New Identities "OpenSSL" Signing CSR Generated by "keytool" "OpenSSL" Acting as a CA (Certificate Authority) "OpenSSL" Generating CA's Private Key "OpenSSL" Self-Signing CA's Public Key "keytool" Generating Maria's Private Key "keytool" Generating Maria's CSR "OpenSSL" Signing Maria's CSR "OpenSSL" Managing Serial Numbers when Signing CSR "keytool" Importing CA's Own Certificate ""keytool" Importing Maria's Certificate Signed by CA Migrating Keys from "keystore" to "OpenSSL" Key Files No "keytool" Command to Export Keys "keytool -genkeypair" Generating PrivateKeyEntry "keytool -exportcert" Exporting PrivateKeyEntry "keytool -printcert" Printing Certificate Details "openssl x509" Viewing Certificate Details "DumpKey.java" Dumping Private Keys Out of "keystore" "openssl enc" Converting Keys from Binary to PEM "openssl dsa" Viewing Private and Public Key Pair Certificate X.509 Standard and DER/PEM Formats X.509 Certificate Standard What Is DER (Distinguished Encoding Rules) Encoding? What Is PEM (Privacy Enhanced Mail) Encoding? Certificate in PEM Format "keytool" Exporting Certificates in DER and PEM "OpenSSL" Viewing Certificates in DER and PEM "OpenSSL" Generating Certificates in DER and PEM "keytool" Viewing Certificates in DER and PEM "keytool" Importing Certificates in DER and PEM Migrating Keys from "OpenSSL" Key Files to "keystore" What Is PKCS#8? What Is PKCS#12? "openssl genrsa" Generating Private Key "openssl pkcs8" Converting Keys to PKCS#8 Format "openssl pkcs12" Merging Key with Certificate "keytool -list" Verifying PKCS#12 Files "keytool -importkeystore" Importing PKCS#12 Files Summary - Migrating "OpenSSL" Keys to "keystore" Summary - Migrating "keystore" Keys to "OpenSSL" Using Certificates in IE 7 Why Using Certificates with Web Browsers? Visiting a "https" Web Site with IE Viewing Certificate Details Viewing Certificate Path Installing Certificate Permanently in IE Managing Certificates in Certificate Stores Exporting Certificates Out of IE 7 OpenSSL Viewing Certificates Exported from IE 7 Importing CA Certificate into IE 7 Importing Certificate Path into IE 7 Using Certificates in Firefox 3 Visiting a "https" Web Site with Firefox Viewing Certificate Details Managing Certificates in Certificate Stores Exporting Certificates Out of Firefox 3 OpenSSL Viewing Certificates Exported from Firefox 3 Importing CA Certificate into Firefox Importing Certificate Path into Firefox References Printable Copy - PDF Version Keywords: Cryptography, Encryption, Security, Tutorial, Example Previous Version: Cryptography Tutorials - Herong's Tutorial Notes Sursa: Cryptography Tutorials - Herong's Tutorial Examples
  11. Voi fi intotdeauna activ.
  12. Pe langa faptul ca e o porcarie, uite cata rahatul: for(i=0;i<1;i++)
  13. Daca nu e ceva strict, poti trimite date din server cand exista. Problema e cu keep-alive-ul, dupa ceva timp, ti se taie conexiunea daca nu se trimit date. Cred ca e ok sa faci un request la 15-20 de secunde, desi nu e rapid, nu faci tone de trafic. Dar mai simplu e sa pastrezi o conexiune activa, cu pachete de keep-alive, si din server trimiti datele cand apar.
  14. Nytro

    Premiile RST

    Eu. Dar nu sunt convins de idei. Cine voteaza? Pe cine? De ce? Pe ce criterii se aleg? Cand se voteaza? Cat timp se voteaza? Conteaza detalii ca vechime, numarul de posturi, numarul de like-uri sau reputatia acelui user?
  15. POC or didn't happen
  16. Nytro

    Premiile RST

    Cred ca daca pun la vot, "Cati vreti sa NU mai fiu administrator", am o vaga impresie ca va trebui sa imi dau demisia Nu, daca noi decidem ca un moderator a gresit, discutam cu el si se rezolva. Apoi, 5 noiembrie? Cu asta ai stricat tot.
  17. Cu ce l-ar incanta pe un utilizator sa vada IP-urile cu care a intrat? Sigur, sa poata vedea daca altcineva a intrat pe contul sau, dar presupunandu-se ca e un forum de securitate IT, nu prea ar trebui sa fie cazul... PS: Acum ceva timp, tex a dat un UPDATE ... SET ipaddress = "127.0.0.1", fara WHERE, deci intelegti cam care e ideea.
  18. Nytro

    Polonic is back

    Membri: 85,146 Sa vedeti cati vor fi diseara. :-> Continua Polonic.
  19. Linux Gaming News: Vote on Your Linux Games Now We've known for a while that Valve is bringing Steam to Linux. One of the most exciting Steam projects for Linux gamers is... || Join the chat: http://bit.ly/nixgoogleplus || Steam Greenlight, where we, the gamers, can vote on which games we want to see made. In this week's OS.ALT I discuss Steam Greenlight and how it impacts Linux Games. Via: Facebook...
  20. Nytro

    Marsul unionist

    Merge greu
  21. Live streaming: http://www.privesc.eu/Arhiva/12404/Marsul-unionist-din-16-septembrie-2012 Am scos si eu steagul cu Romania pe geam.
  22. Warn - Categorie gresita.
  23. Acum, haideti cel putin sa incercam, sa vedem ce iese. Vom discuta cei din staff, si vom face categoria respectiva, sper ca diseara.
×
×
  • Create New...