Implement Shared Secret for JavaScript