If I encrypt the same file twice with GnuPG, using the same key, will I get the same result? or is it using some random/psudeo-random segment to improve security like rsynccrypto?
Generally speaking, no, encrypting the same file with the same key will not produce the same file, for three reasons:
The OpenPGP format (which GnuPG implements) uses hybrid encryption: a random, symmetric key is encrypted with the recipient's public key (of type RSA or ElGamal), and that symmetric key is itself used to encrypt the message body with a symmetric encryption algorithm. Hybrid encryption is used because asymmetric encryption are very limited in their range (e.g. a 2048-bit RSA key cannot encrypt more than 245 bytes in one go) and have high overhead (both in CPU and resulting message size). Since the symmetric key is not saved anywhere on the sender's side, a new random key will be created each time, and will be different with overwhelming probability.
Asymmetric encryption itself is randomized. E.g., with RSA, the padding includes random bytes. This is needed "in general", because the public key is public, so everybody knows it; if encryption was deterministic, attackers could run an exhaustive search on the message. This would not be an issue in the specific case of OpenPGP (the message is a random key, large enough to defeat exhaustive search on its own), but standards for RSA or ElGamal have a larger scope and include random padding.
When doing the symmetric encryption itself, a random IV is used, and will be different (with overwhelming probability) for each invocation. See section 5.7 for details.
The third point also applies when doing password-based encryption (encryption is done with a password, not with a recipient's public key). Password-based encryption also adds a fourth randomization, which is the salt in the password-to-key transform.
GnuPG encryption is not deterministic and thus will return different output for each run. Encrypting, then decrypting is deterministic of course and will always return the same contents.
GnuPG uses asymmetric encryption, which is slow when encrypting huge amounts of data. For this reason, it uses your private key to encrypt a random block cipher which is again used to encrypt your data.
Each time you're encrypting data, a new random block cipher will be generated, so the encrypted data will look different.
I encrypted the same document twice and calculated the MD5 checksums after each encryption:
$ gpg --encrypt test.txt $ md5 test.txt.gpg MD5 (test.txt.gpg) = f2f6a07e0d7ae9899315d0471c2596bc $ gpg --encrypt test.txt $ md5 test.txt.gpg MD5 (test.txt.gpg) = b57d4c360b1c3c6b2202ce6c3d32cdd8