JavaScript library encryption