Could you please elaborate on the process of transmitting bits in the realm of digital communication? I'm particularly interested in understanding the technicalities behind it, such as the encoding methods used, the mediums through which these bits traverse, and any potential challenges or limitations that may arise during transmission. Furthermore, how does this process ensure the integrity and security of the data being transmitted? Your insights would be greatly appreciated.