Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Kali Linux CTF Blueprints

You're reading from   Kali Linux CTF Blueprints Build, test, and customize your own Capture the Flag challenges across multiple platforms designed to be attacked with Kali Linux

Arrow left icon
Product type Paperback
Published in Jul 2014
Publisher Packt
ISBN-13 9781783985982
Length 190 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Cameron Buchanan Cameron Buchanan
Author Profile Icon Cameron Buchanan
Cameron Buchanan
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Microsoft Environments 2. Linux Environments FREE CHAPTER 3. Wireless and Mobile 4. Social Engineering 5. Cryptographic Projects 6. Red Teaming A. Appendix Index

Scenario 3 – RC4, my god, what are you doing?


RC4 was an encryption method briefly in vogue for its speed and simplicity. Anyone who designs or implements cryptography will know that those are two words that, while good when applied with other words, such as secure, thoroughly tested, and 300 rounds, are not great when they make up the core of a description.

RC4 can simply be described as PT XOR key = CT, the explanation to which is as follows:

  • PT is your plaintext value

  • Key is the secret value set to encrypt the values

  • CT is the encrypted cipher text

XOR is exclusive or or bitwise addition, which is where two values are broken down into binary, overlayed, and where the numbers match, a 0 is returned, and where the numbers don't match, a 1 is given.

Setup

Setup can be easily achieved using the PyCrypto library and the following code:

From Crypto.Cipher import XOR
Cipher = XOR.new("iamakey")
msg = str(raw_input("message to send:")
cipher_text = cipher.encrypt(msg)
printcipher_text.encode('base64...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image