Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
browserify-steam-totp
Advanced tools
This is a library for creating a 2fa Steam code, as well as for creating a confirmation code. The library can be used both in Node.js and in the Browser.
npm install browserify-steam-totp
import { SteamTotp } from 'browserify-steam-totp';
const code = SteamTotp.generateAuthCode('uB08PipZey9znlgjywrQbId3doc=');
console.log('Steam Guard Code: ', code);
secret
- The secret key as a string.timeOffset?
- Time offset in seconds (optional).If the code has been generated, the method will return it.
code
- The auth code.const { SteamTotp } = requier('browserify-steam-totp');
import { SteamTotp } from 'browserify-steam-totp';
This class can be used to generate steam auth code or generate steam confirm key.
ALPHABET
Constant with symbols for generating steam auth code.
DIGITS
Steam auth code length constant.
PERIOD
Constant with steam auth code update time.
bufferizeSecret(secret: string): WordArray
Convert the secret string into a format that can be used by CryptoJS.
Parameters:
Returns: WordArray
The parsed secret as a CryptoJS WordArray.
generateAuthCode(secret: string, timeOffset?: number): string
Generate a one-time authentication code (TOTP).
Parameters:
Default Value
timeOffset: number = 0 - Time offset in seconds (optional).Returns: string
The generated one-time authentication code string.
generateConfirmationKey(identitySecret: string, time: number, tag: string): string
Generate a confirmation key for Steam.
Parameters:
Returns: string
The confirmation key string.
getDeviceId(steamid: string): string
Generate the device ID based on the SteamID.
Parameters:
Returns: string
The device ID string.
getTime(timeOffset?: number): number
Get the current time in seconds, optionally with a time offset.
Parameters:
Optional
timeOffset: number - Time offset in seconds (optional).Returns: number
The current time in seconds number.
getTimeOffset(callback: (error?: Error, offset?: number, time?: number) => void): void
Get the time offset from Steam servers using a callback.
Parameters:
callback: (error?: Error, offset?: number, time?: number) => void - The callback function to return the error or result.
Parameters:
Optional
error: ErrorOptional
offset: numberOptional
time: numberReturns: void
Returns: void
getTimeOffsetAsync(): Promise<{ offset: number; time: number }>
Asynchronously get the time offset from Steam servers.
Returns: Promise<{ offset: number; time: number }>
An object with the time offset and the request time.
Consult the Documentation
Please check the contributing guidelines
Copyright (c) 2019 Eugene
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Steam-style generate totp codes by secret
We found that browserify-steam-totp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.