Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Here's another....file I/O difficulties.
#35
Zack, you've gotten me hooked on neat little encryption methods. Here's one I just finished. It's sort of like a combination of your original algorithm, with Winer's. Here's the procedure:
Code:
'' original
'' ^^^
'' key^
''  key^
''   key^
''    key^
''     key^
''      key
''       ke
''        k
Basically, it works like Winer's by overlaying the key across the original, but mine overlaps the key, essentialy producing the same effect as the method you originally posted, but with the first len(key)-1 characters being encrypted differently. I'm not an expert, but I suppose that for this type of encryption you mght as well employ your algorithm, but I think the function looks neat nonetheless. Smile Here is the code:

Code:
option explicit
option byval

function StylinizeText( byref text as string, byref key as string ) as string
    if( strptr(text)=0 ) then return ""
    if( strptr(key)=0 ) then return text

    dim as string result => text
    dim as integer resIndex = 0, resLength = len(result), keyLength = len(key)
    while( resIndex < resLength )
        dim as integer keyIndex = 0
        while( (keyIndex < keyLength) and ((resIndex + keyIndex) < resLength) )
            result[resIndex + keyIndex] xor= key[keyIndex]
            keyIndex += 1
         wend
        resIndex += 1
     wend : return result
end function

function deStylinizeText( byref text as string, byref key as string ) as string
    return StylinizeText( text, key )
end function
stylin:
Reply


Messages In This Thread
Here's another....file I/O difficulties. - by Anonymous - 01-10-2006, 01:26 PM
Here's another....file I/O difficulties. - by stylin - 01-14-2006, 11:38 PM
Here's another....file I/O difficulties. - by DrV - 01-16-2006, 03:08 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)