# Algorithm

Encrypting

1. Perform left circular shift the specified byte array every 8 bits. (num of shift: 0-7)
* Perform bit-invertion in case of the shifting position is 0.
2. Encode the bit-rotated byte array into a newly-allocated byte array using the Base64 encoding scheme.

Decrypting

Manipulate in the opposite way.

* BSB64 is not intended to be used where secrecy is of any concern.

# Examples

Normal Base64

Source Text(ASCII) abc
Source octets 97 (0x61)98 (0x62)99 (0x63)
Bit pattern 01100001 01100010 01100011
Index 2422935
Base64-encoded YWJj
Encoded octets 89 (0x59)87 (0x57)74 (0x4A)106 (0x6A)

BSB64 (n = 1)

Source Text(ASCII) abc
Source octets 97 (0x61)98 (0x62)99 (0x63)
Bit pattern 01100001 01100010 01100011
Bit rotation 11000010 11000100 11000110
Index 4844196
Base64-encoded wsTG
Encoded octets 119 (0x77)115 (0x73)84 (0x54)71 (0x47)

BSB64 (n = 0)

Source Text(ASCII) abc
Source octets 97 (0x61)98 (0x62)99 (0x63)
Bit pattern 01100001 01100010 01100011
Bit invertion 10011110 10011101 10011100
Index39415428
Base64-encodednp2c
Encoded octets 110 (0x6E)112 (0x70)50 (0x32)99 (0x63)

# Implementation

Java, JavaScript, VBA implementation is available on GitHub.
Python implementation is coming soon.