I found this link but it is applicable for D2009 onwards not Delphi 7:
Basically my requirement is these two methods: (Shown as Pseudocode)
resultBase64String := EncodeBase64(bytearray, byteArraySize);
resultByteArray := DecodeBase64(base64String)
with some sample code on how to use it, the string to decode could be: "1234"