I call this LBCBFBB ,last block cypertext borrow from before block
more secure then adding zero's or other know pad methods.
so why shall we give someone know plaintext to play with?
------------------
last block procedure
LOCAL pad$ , before$
before$=sMessage
GET$ #1, LastBlockSize , sMessage
IF (LEN(sMessage) MOD 16) <> 0 THEN
' is not mod 16 so now we borrow the pad bytes from the previous block of already ENCODED plaintext.
IF EnCode=1 THEN
pad$=RIGHT$(WorkString,16) ' from memory just encoded (so encoded plaintext)
ELSE
pad$=RIGHT$(before$,16) ' from disk not yet decoded (so encoded plaintext)
END IF
FOR i = 1 TO 16 - (LEN(sMessage) MOD 16) ' pad the string to mod 16
sMessage = sMessage + MID$(pad$,i,1)
NEXT
END IF
Ok Guys Shoot At It, Better Methods Welcome

more secure then adding zero's or other know pad methods.
so why shall we give someone know plaintext to play with?
------------------
last block procedure
LOCAL pad$ , before$
before$=sMessage
GET$ #1, LastBlockSize , sMessage
IF (LEN(sMessage) MOD 16) <> 0 THEN
' is not mod 16 so now we borrow the pad bytes from the previous block of already ENCODED plaintext.
IF EnCode=1 THEN
pad$=RIGHT$(WorkString,16) ' from memory just encoded (so encoded plaintext)
ELSE
pad$=RIGHT$(before$,16) ' from disk not yet decoded (so encoded plaintext)
END IF
FOR i = 1 TO 16 - (LEN(sMessage) MOD 16) ' pad the string to mod 16
sMessage = sMessage + MID$(pad$,i,1)
NEXT
END IF
Ok Guys Shoot At It, Better Methods Welcome
