Is it fair for us to conclude XOR string encryption is less secure than well known encryption (Say Blowfish)

Posted by Yan Cheng CHEOK on Stack Overflow See other posts from Stack Overflow or by Yan Cheng CHEOK
Published on 2011-01-11T01:40:50Z Indexed on 2011/01/11 1:53 UTC
Read the original article Hit count: 549

Filed under:
|

I was wondering, is it fair to conclude, XOR string encryption is less secure than other encryption method, say Blowfish

This is because for both methods, their input are

  1. Unencrypted string
  2. A secret key

string XOR(string value,string key)
{
    string retval(value);

    short unsigned int klen=key.length();
    short unsigned int vlen=value.length();
    short unsigned int k=0;
    short unsigned int v=0;

    for(v;v<vlen;v++)
    {
        retval[v]=value[v]^key[k];
        k=(++k<klen?k:0);
    }

    return retval;
}

Is there any proof that XOR encryption method is more easy to be "broken" than Blowfish if the same key is being chosen?

© Stack Overflow or respective owner

Related posts about c++

Related posts about encryption