RC4 Encryption (byte ptr's)

BlitzMax Forums/BlitzMax Programming/RC4 Encryption (byte ptr's)

plash(Posted 2008) [#1]
I'm referring to the code here: http://www.blitzbasic.com/codearcs/codearcs.php?code=1711

1) What does type does '@@ Ptr' refer to? (noel's code)

2) I'm going to be encrypting pixmap pixel data (byte ptr), can I just use bytes in the encryption instead of shorts? (referring to outbuf@@ ptr)

This is what I've conjured up so far.. don't know what to do next.


EDIT: Wait a sec.. Since this is using a ptr, should I even bother returning a copy of the data? Instead change it to just modify the block of memory? (It isn't necessary for the image to be intact afterwards, as I will just be loading in a new pixmap after encrypting and sending the data out)
And how would I get the size of the data after encryption? (seeing as width*height*4 wont work, the encryption should raise the size IIRC)


Perturbatio(Posted 2008) [#2]
@@ is a short I think


Yan(Posted 2008) [#3]
% = Int
%% = Long

@ = Byte
@@ = Short

# = Float
! = Double

$ = String


the encryption should raise the size IIRC
Nope.


plash(Posted 2008) [#4]
That was suprisingly simple... (thanks for the pointers, I always use SuperStrict, and found the :<type> to be much easier - never bothered learning them)
It modifies the data directly now :)