Giter Site home page Giter Site logo

Comments (5)

Finb avatar Finb commented on June 25, 2024 1

旧版本不兼容加密,打算加个提示使用加密之前升级app。
第一种方案只需app修改就行,改动的代码也不多

from bark-server.

hellodword avatar hellodword commented on June 25, 2024

十分期望能参与贡献

from bark-server.

Finb avatar Finb commented on June 25, 2024

我最近正在尝试加上加密
第一种就是用户端自行加密发送的内容,服务端转发给app,app使用用户设置的秘钥解密
第二种对用户透明,服务端将数据加密后发送到app,app解密

目前倾向于实现第一种,因为没有兼容性问题。第二种无法判断接受用户的app版本是否支持加密

第一种的缺点就是发送端可能会复杂一点,类似

#!/usr/bin/env bash

set -e

# bark key
deviceKey='your key'
# push payload
json='{"body": "test"}'

# must be 16 bytes long
key='1234567890123456'
iv='1234567890123456'

# openssl requires Hex encoding of manual keys and IVs, not ASCII encoding. 
key=$(printf $key | xxd -ps -c 200)
iv=$(printf $iv | xxd -ps -c 200)

ciphertext=$(echo -n $json | openssl enc -aes-128-cbc -K $key -iv $iv | base64)
echo $ciphertext
# curl --data-urlencode "ciphertext=$ciphertext" https://api.day.app/$deviceKey

from bark-server.

hellodword avatar hellodword commented on June 25, 2024

我最近正在尝试加上加密
第一种就是用户端自行加密发送的内容,服务端转发给app,app使用用户设置的秘钥解密
第二种对用户透明,服务端将数据加密后发送到app,app解密

目前倾向于实现第一种,因为没有兼容性问题。第二种无法判断接受用户的app版本是否支持加密

第一种的缺点就是发送端可能会复杂一点

太棒了🥳

第一种正是端到端加密。

发送复杂是可以理解的,但因为可以通过 ciphertext 之类的扩展字段以及其它方式保持兼容,所以对这个特性没有需求的用户是可以无感的。

不过不熟悉 iOS 开发,不清楚那边保持兼容的代价如何。

from bark-server.

Finb avatar Finb commented on June 25, 2024

1.3.0 版本已经加上了推送加密

from bark-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.