New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@fe-cookie/server-request-crypto

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fe-cookie/server-request-crypto

### 使用场景

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

server-request-crypto

使用场景

    • 客户端与 BFF 之间进行接口加密校验
    • BFF 与第三方语言加密校验 (例如:php 接口)
### 加密规则
  • 获取 GET,POST 请求的请求体参数,转换为 JSON 格式。
  • 请求体中附加时间戳参数,参数字段为_,值为时间戳。(备注:时间戳优先取请求体中的_字段,若没有则取 header头中的 x-timestamp字段)。
  • 对转换后的请求体 JSON 进行排序,(此处参考排序规则)。
  • 对排序好的 JSON 进行字符串拼接,(此处参考拼接规则) 。
  • 拼接好的字符串(通过key=val&)最后再附加上固定盐值得到最后需要加密的字符串(即...&key=val&salt)。
  • 使用MD5的方式加密最后拼接的字符串,得到加密密钥。

取值标识

  • 通过Header头 autho-token\|x-autho-token\|external-token 获取需要匹配的加密字段。 <br >
  • 通过Header头 autho-pass\|x-autho-pass 来觉得是否需要进行加密校验(备注:此字段通常应用于测试,方便于接口测试)。 <br >
  • 优先通过请求体的_字段获得时间戳,其次通过 Header头 x-timestamp 获得时间字段。

FAQs

Package last updated on 18 Sep 2022

Did you know?

Socket

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.

Install

Related posts