Jump to content

  • Log In with Google      Sign In   
  • Create Account

MarkS

Member Since 09 Jan 2001
Online Last Active Today, 05:16 PM

Posts I've Made

In Topic: Breaking out of a nested loop

27 May 2016 - 04:24 PM

you have to set j back to zero tho else it does the job. Also this is how assembly would work


Oh crap! :unsure:


In Topic: Breaking out of a nested loop

27 May 2016 - 02:53 PM

Just replace the for loops with if goto pairs so that goto won't look so lonely.


So...
 

int i = 0, j = 0;
    loop:
        if(i - 1 == j + 1)
            goto outer;
    ++j;
    if(j < 10)
        goto loop;
    j = 0;
    ++i;
    if(i < 10)
        goto loop;

outer:

Seems pretty clean to me!

[edit] Fixed glaringly obvious and embarrassing mistake...


In Topic: Question about encryption and ransomware.

21 May 2016 - 03:01 AM

I got that. I am questioning what comes next.
 
If the purpose is to retrieve the original file, since you can already download the original from somewhere else, then you don't need to decrypt it.
 
If the purpose to somehow discover the decryption key so you can decrypt other encrypted files, then comes the question if the other files were unchanged before being encrypted.
 
If the purpose is solely a study of decryption, then why the randomware example?


I shouldn't have mentioned ransomware. It was the first thing that popped in my mind. The purpose was to discover the key. I was curious if this was possible. My understanding of encryption is to keep others from viewing a file. This, of course, would assume that the unauthorized viewer did not have access to the decrypted file, which makes sense. However, if you could correctly guess one file and then retrieve an unencrypted copy from somewhere, I was assuming that it might be possible to use it to find the key. I was unaware of the plain text attack that Olof mentioned. If this were possible, it would make encryption pretty much useless, so I can see why it is addressed.

This really was never a discussion about ransomware.


In Topic: Question about encryption and ransomware.

20 May 2016 - 06:08 AM

Try not to open dodgy files and have backups.That's the easier way to keep your files safe.

I was just curious if this was a possible workaround for encryption. Ransomware comes to mind since it is such a problem today.


In Topic: Question about encryption and ransomware.

20 May 2016 - 06:00 AM

Oh well. I figured it couldn't be that easy.


PARTNERS