News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Encryption procedure

Started by Farabi, August 16, 2010, 02:37:53 PM

Previous topic - Next topic

fearless

Having a quick look at your encryption for the first example i did notice that it does not change the contents much if you change one letter of the source plaintext to encrypt. I think that it would be vulnerable to a Substitution attack. Ideally when you change one letter or one bit of the plaintext, there should be a cascade effect that changes all of the content. To do this you would need to use a block cipher, that encrypts the data based on the previous word/byte/bits. At the very basic level a simple xor would be used. But this can be combined with S-Boxes to further obfuscate.
ƒearless

Antariy

Quote from: Farabi on August 19, 2010, 03:05:45 AM
THat was amazing you can break the password, I guess my encryption method is sucks, or antary knowledge if far beyond.

Don't exaggerate my work, this is not hard, really.

Your encryption method is NO bad, with consideration what this is your start in encryption.
You can use it for not very critical tasks. Folder lock - might be one from them, because end user is not have enough technical knowledge to break your app.



Alex

Antariy

Quote from: cork on August 19, 2010, 07:14:50 AM
to be paid to the person who can decode this message, written in contemporary English. I will tell you ahead of time the encryption method - a one-time book. All the computers on Earth, in tandem, could not decrypt this, if run from now until the end of time.

No, probably we spent to this only 4,7125395124994920600970896338283e+4906 ^ 2048 years.

I think, even if you increase your prize to 11-digits number of $, you don't compensate all power of calculation :)

And, I don't know, how you assured in this, but data which you post contain very many redundant and "suspicious" semi-cyclic data. So, if big research will be done, and power computer runs the decryption (not brute-force), decryption of this is possible, theoretically.



Alex

Antariy

Quote from: Farabi on August 19, 2010, 11:13:49 AM
Okay I got another new great super duper method of encryption, I will take a random number based on the gravity caused by moon, and then multiply it with the clock of processor and add it with the current peak of CPU usage, but the problem is how to de encrypt it?  :lol

How? What difference? This is best encryption: even author of encryption cannot decrypt his data, so, this is same reliable in world :)



Alex

Antariy

This is other "challenge" :)

Try to "decrypt" this:

"αμμ ισ ποσσιβμε"

This is phrase in *English*, which will be converted in some manner.

So, say, which phrase is this, and how they "encrypted".

Do do this "encryption" no needed in any special software, and this type of "encryption" can be strongest, than this.

For usability, I add this text to Unicode text file in archive attached to post.



Alex

dedndave

all is possible ?
my Greek is a little rusty - lol

cork


frktons

Quote from: dedndave on August 20, 2010, 02:12:06 AM
all is possible ?
my Greek is a little rusty - lol

Your greek is rusty but it works fine  :lol
Mind is like a parachute. You know what to do in order to use it :-)

dedndave

well - he threw me off by using "mu" where i would have thought it would be "lamda"

Antariy

Quote from: dedndave on August 20, 2010, 02:12:06 AM
all is possible ?
my Greek is a little rusty - lol


Really, all is possible. This is true, or not? :)
This is "encryption" for fun :)

How "algo" I use, Dave? Or this is only logical substitution (which is make honour to you)?



Alex
P.S. Dave, you are good with stegano?

KeepingRealBusy

Alex,

I have not played much with stegano, I know what it is, I just am not interested.

Dave.

Antariy

Quote from: KeepingRealBusy on August 20, 2010, 11:23:59 PM
Alex,

I have not played much with stegano, I know what it is, I just am not interested.

Dave.

To Dave (KRB): Dave, sorry for inconvenience, I write post directed to dedndave - he "break" pharese in "greek".



Alex

dedndave

i took some Greek in high school (ancient Greek - lol)
about all i remember is the alphabet (hey - a Greek-derived English word)

Rockoon

Quote from: fearless on August 19, 2010, 02:35:17 PM
Having a quick look at your encryption for the first example i did notice that it does not change the contents much if you change one letter of the source plaintext to encrypt. I think that it would be vulnerable to a Substitution attack. Ideally when you change one letter or one bit of the plaintext, there should be a cascade effect that changes all of the content.

To elaborate on this a little better.

A good encryption system, when using the same key but different messages to encrypt, you should only expect about 50% of the bits matching in the two outputs regardless of how small or large the change is to the message.

Essentially..

0.5 = P(message1.bit(i) = message2.bit(i))

If this doesnt hold true, then there is a big weakness in your system.
When C++ compilers can be coerced to emit rcl and rcr, I *might* consider using one.

Farabi

Hello guys, I guess there is no point to keep this for my self, I got no benefit if my harddisk is broken.
Even this function is just a simple one, at least it will be hard do decrypt if you are smart enough like, double the encryption, or not specifying the extension of your file, or even worse, the encrypted data, is wrote on your own file format, it will halt the cracker and wasting their precious time for a week (I Hope).

Have fun with this, and dont ask me anything if you forget the password since I had no idea to breaking it.



mAlloc proc nSize:dword

add nSize,4
invoke GlobalAlloc,GMEM_ZEROINIT or GMEM_FIXED,nSize
.if eax==0
invoke PERR
invoke MessageBox,NULL,addr mem_error,NULL,MB_OK
.endif

ret
mAlloc endp

fEncrypt proc uses esi edi lpData:dword,nDataSize:dword,lpKeys:dword
LOCAL data:dword
LOCAL keysz:dword
LOCAL cntr:dword
LOCAL key:word

mov ecx,nDataSize
shl ecx,1

invoke mAlloc,ecx
mov data,eax

invoke lstrlen,lpKeys
mov keysz,eax

mov esi,lpData
mov edi,lpKeys

xor ecx,ecx
mov cntr,ecx
loop_encrypt:
push ecx
movzx edx,byte ptr [esi+ecx]
ror dl,4
mov eax,cntr
mov key,dx
movzx edx,byte ptr[edi+eax]
add key,dx
mov eax,data
shl ecx,1
mov dx,key
mov [eax+ecx],dx

inc cntr
mov eax,keysz
.if cntr>eax
push 0
pop cntr
.endif

pop ecx
inc ecx
cmp ecx,nDataSize
jl loop_encrypt

mov eax,data

ret
fEncrypt endp

fDecrypt proc lpData:dword,nDataSize:dword,lpKeys:dword
LOCAL data:dword
LOCAL keysz:dword
LOCAL cntr:dword
LOCAL key:word

mov ecx,nDataSize
shr ecx,1

invoke mAlloc,ecx
mov data,eax

invoke lstrlen,lpKeys
mov keysz,eax

mov esi,lpData
mov edi,lpKeys

shr nDataSize,1

xor ecx,ecx
mov cntr,ecx
loop_encrypt:
push ecx
shl ecx,1
mov dx,[esi+ecx]
mov key,dx
shr ecx,1
mov eax,cntr
movzx dx,byte ptr[edi+eax]
sub key,dx
mov dx,key
ror dl,4
mov eax,data
mov [eax+ecx],dl

inc cntr
mov eax,keysz
.if cntr>eax
push 0
pop cntr
.endif
pop ecx
inc ecx
cmp ecx,nDataSize
jl loop_encrypt

mov eax,data

ret
fDecrypt endp


Here is how I used it

.if wParam==0
invoke OpenFileDialog,hWnd,hInstance,CADD("Pilih Berkas"),0
movzx ecx,byte ptr [eax]
.if ecx!=0
push eax
invoke filesize,eax
mov fsz,eax
invoke mAlloc,fsz
mov data,eax
pop ecx
push ecx
invoke read_disk_file,ecx,addr data,addr fsz2
invoke GetTextInput,hWnd,hInstance,0,CADD("Input Password"),0,addr buff
invoke fEncrypt,data,fsz,addr buff
mov data2,eax
invoke GlobalFree,data
shl fsz,1
invoke GetAppPath,addr buff
invoke SetCurrentDirectory,addr buff
pop ecx
invoke write_disk_file,CADD("Test.fef"),data2,fsz

; invoke fEncrypt,CADD("Farabi Onan"),11 ,CADD("1234567")
; mov data,eax
; invoke fDecrypt,data,22,CADD("1234567")
; invoke write_disk_file,CADD("Test.txt"),eax,11
.endif
.elseif wParam==1
invoke OpenFileDialog,hWnd,hInstance,CADD("Pilih Berkas"),addr fef
movzx ecx,byte ptr [eax]
.if ecx!=0
push eax
invoke filesize,eax
mov fsz,eax
invoke mAlloc,fsz
mov data,eax
pop ecx
invoke read_disk_file,ecx,addr data,addr fsz2
invoke GetTextInput,hWnd,hInstance,0,CADD("Input Password"),0,addr buff
invoke fDecrypt,data,fsz,addr buff
mov data2,eax
invoke GlobalFree,data
invoke GetAppPath,addr buff
invoke SetCurrentDirectory,addr buff
invoke GetTextInput,hWnd,hInstance,0,CADD("Name of File"),0,addr buff
shr fsz,1
invoke write_disk_file,addr buff,data2,fsz
.endif
.endif


Sorry cant post any project for this, I got no time so I just copy-pasted from my current code, and it is too complex for you guys. It is very embarasing if you see how bad Im coding.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"