New stream cipher algorithm, Adaptive Stream Cipher
From: Benjamin Choi (contact_at_technosoft21.com)
Date: 08/16/03
- Next message: Isaac: "Re: License questions"
- Previous message: Michael Amling: "Re: "Small" problem"
- Next in thread: John E. Hadstate: "Re: New stream cipher algorithm, Adaptive Stream Cipher"
- Reply: John E. Hadstate: "Re: New stream cipher algorithm, Adaptive Stream Cipher"
- Reply: Tom St Denis: "Re: New stream cipher algorithm, Adaptive Stream Cipher"
- Reply: Mark Wooding: "Re: New stream cipher algorithm, Adaptive Stream Cipher"
- Reply: Benjamin Choi: "Re: New stream cipher algorithm, Adaptive Stream Cipher"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 15 Aug 2003 21:21:29 -0700
Hello,
Lately I've created a simple encryption algorithm (inspired by RC4's
design) which generates a seemingly random stream of bytes which is
then combined with the message using bitwise XOR. It generates the key
using the supplied passphrase as well as the message to be encrypted,
giving it its name of Adaptive Stream Cipher. It achieves an avalanche
effect. It uses two arrays: the SBox and the Key Array.
I cannot claim that it is unbreakable; no encryption is unbreakable
except one time pads. However I have tried to make this a little like
a one time pad generator (but nowhere as random). And I am sure that
it is at least safer than normal XOR encryption with a plaintext key.
However, one interesting thing about the generated key: even when
encrypting a 30k text message with lots of patterns using a plain text
passphrase, the key generated (30k naturally) compressed into about
30k. The key generated by RC4 also fails to compress well. I think
this means both keystreams have few patterns. Does this make them more
random?
Please help me cryptanalyse it for weakness. I am sure there would be
quite a few.
Visual Basic 6 source code implementation:
------------------------------------------------------------
Option Explicit
Dim SBox(255) As Long
Dim KeyArr(255) As Long
Sub ASCInitialise(Msg As String, Key As String, Encrypt As Boolean)
Dim i As Long
Dim Seed As Long
'Initialise arrays
For i = 0 To 255
KeyArr(i) = Asc(Mid(Key, (i Mod Len(Key)) + 1, 1))
KeyArr(i) = (KeyArr(i) + Asc(Mid(Key, (i Mod (Len(Key) - 1)) +
2, 1))) Mod 255
SBox(i) = KeyArr(i) Xor i
Next
'Replace SBox elements
Seed = 0
For i = 0 To 255
Seed = ((Seed Xor SBox(i)) + KeyArr(i)) Mod 255
SBox(i) = (SBox(i) + Seed) Mod 255
Next
End Sub
Public Function ASCCrypt(Msg As String, Key As String, Encrypt As
Boolean) As String
Dim i As Long
Dim ASCMsg As String
Dim ASCString As String
ASCMsg = Msg
ASCInitialise ASCMsg, Key, Encrypt
For i = 1 To Len(ASCMsg)
ASCString = ASCString & Chr(ASCPureCrypt(Asc(Mid(ASCMsg, i,
1)), Encrypt, i))
Next
ASCCrypt = ASCString
End Function
Public Function ASCPureCrypt(Msg As Byte, Encrypt As Boolean, BytePos
As Long) As Byte
Dim k As Long
Dim lngCipher As Long
'Adapt SBox
If Encrypt = True Then
SBox((BytePos + 1) Mod 255) = (SBox((BytePos + 1) Mod 255) +
Msg) Mod 255
End If
k = SBox(BytePos Mod 255)
k = k Xor KeyArr(BytePos Mod 255)
'Combine message with keystream
lngCipher = Msg Xor k
'Adapt SBox
If Encrypt = False Then
SBox((BytePos + 1) Mod 255) = (SBox((BytePos + 1) Mod 255) +
lngCipher) Mod 255
End If
ASCPureCrypt = lngCipher
End Function
------------------------------
Benjamin Choi
contact at technosoft21 dot com
- Next message: Isaac: "Re: License questions"
- Previous message: Michael Amling: "Re: "Small" problem"
- Next in thread: John E. Hadstate: "Re: New stream cipher algorithm, Adaptive Stream Cipher"
- Reply: John E. Hadstate: "Re: New stream cipher algorithm, Adaptive Stream Cipher"
- Reply: Tom St Denis: "Re: New stream cipher algorithm, Adaptive Stream Cipher"
- Reply: Mark Wooding: "Re: New stream cipher algorithm, Adaptive Stream Cipher"
- Reply: Benjamin Choi: "Re: New stream cipher algorithm, Adaptive Stream Cipher"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|