boho 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,77 +1,235 @@
1
+ # Boho
1
2
 
3
+ [English](README.md) | [한국어](README.ko.md)
2
4
 
3
- # Boho
5
+ **Lightweight encryption and authentication for Node.js, browsers and Arduino**
6
+
7
+ Boho is a JavaScript library providing shared-key authentication and encrypted
8
+ binary messages. It runs in Node.js and browsers; the Arduino implementation is
9
+ available in a separate repository. The current protocol is a custom SHA-256-based
10
+ construction and must not be treated as providing the same guarantees as standard
11
+ AEAD or TLS.
12
+
13
+ - `boho` means **protection** in Korean.
14
+
15
+ ---
16
+
17
+ ## Why Boho?
18
+
19
+ Boho is designed for environments where **you control the code and key provisioning
20
+ at both endpoints**. With known peers such as an Arduino device, your own web app
21
+ and a personal server, you can provision a secret securely before using it for
22
+ authentication and encryption.
23
+
24
+ Many encryption algorithms already exist, but practical development also needs
25
+ peer authentication, packet formats, key provisioning and compatibility between
26
+ devices and browsers. Boho combines a SHA-256-based keystream, XOR encryption,
27
+ shared-key authentication and binary packets. Its distinction is **a common
28
+ implementation and application model for Arduino, Node.js and browsers**, rather
29
+ than novelty in XOR itself.
30
+
31
+ ### Where pre-shared symmetric keys fit
32
+
33
+ | Environment | Example provisioning path |
34
+ | --- | --- |
35
+ | Embedded devices you build | Provision device-specific keys over USB or serial during manufacture or installation |
36
+ | Your own web app and personal device | Users enter a key obtained separately, or register it through trusted pairing |
37
+ | Servers under common administration | Distribute keys through SSH, an existing TLS channel or a secret management system |
38
+
39
+ If initial key sharing is handled, appropriate symmetric encryption and
40
+ authentication can provide secure communication. Peers can authenticate through
41
+ their shared key without a certificate authority. Trust rests on the provisioning
42
+ path and endpoint software. Sharing one key across many devices expands both its
43
+ authentication scope and the impact of a leak; plan device-specific keys,
44
+ rotation and revocation.
45
+
46
+ Writing a web app yourself does not automatically keep its key secret. A common
47
+ secret included in a public JavaScript bundle is readable by visitors.
48
+
49
+ ### XOR and one-time pads
50
+
51
+ XOR is a simple operation: applying it twice with the same value restores the
52
+ original value.
53
+
54
+ ```text
55
+ Encryption: C = P XOR S
56
+ Decryption: P = C XOR S
4
57
 
5
- **Node.js, 브라우저, Arduino를 위한 경량 암호화 및 인증 프로토콜**
58
+ P: plaintext, C: ciphertext, S: keystream
59
+ ```
6
60
 
7
- Boho는 공유 키 기반 인증과 바이너리 암호화 메시지를 제공하는 JavaScript 라이브러리입니다. Node.js와 브라우저에서 동작하며, Arduino용 구현은 별도 저장소에서 제공합니다. 현재 프로토콜은 SHA-256을 조합한 자체 암호 구성이며, 표준 AEAD나 TLS의 보안 보장과 동일하게 취급하지 않아야 합니다.
61
+ A uniformly random keystream that is independent of the plaintext, as long as the
62
+ data, kept secret and used only once provides the perfect secrecy of a one-time
63
+ pad (OTP). Under these conditions even simple XOR forms the basis of strong
64
+ encryption. The practical difficulty is supplying a new 1 MB secret pad to both
65
+ endpoints for every 1 MB of data. Repeating a short fixed key does not meet these
66
+ conditions.
67
+
68
+ Reusing a keystream exposes `C1 XOR C2 = P1 XOR P2`, revealing a relationship
69
+ between the plaintexts. Security depends on keystream generation and avoiding
70
+ reuse, not on the complexity of XOR.
71
+
72
+ ### A “virtual OTP” generated with SHA-256
73
+
74
+ Hashing sufficiently unpredictable secret input together with message-specific
75
+ values, while varying a block index, can form a construction that generates a
76
+ keystream of the required length. Both peers can reproduce the same output from
77
+ the same input, without storing or transmitting the entire pad. Boho's usual
78
+ `set_key` path is:
79
+
80
+ ```text
81
+ K = SHA256(input key)
82
+ B = SHA256(K || salt12)
83
+ S1 = SHA256(B || LE32(1))
84
+ S2 = SHA256(B || LE32(2))
85
+ …
86
+ S = S1 || S2 || … // use only the plaintext length
87
+ C = P XOR S
88
+ ```
8
89
 
9
- - `boho`는 **보호**를 의미합니다.
90
+ `||` means byte concatenation; `LE32` is a four-byte little-endian integer.
91
+ SHA-256 produces 32 bytes, so a 70-byte plaintext uses two full blocks and the
92
+ first six bytes of the third. Decryption XORs with the same keystream rather than
93
+ reversing the hash.
94
+
95
+ `salt12` contains seconds (4 bytes), milliseconds (2), a counter (2) and a nonce
96
+ (4). These values are not secret and are available to the receiver. **Anyone can
97
+ compute a hash of public random values alone.** The shared secret key is the
98
+ essential secret input; avoiding reuse of `salt12` under the same key is also
99
+ important.
100
+
101
+ “Virtual OTP” here describes a hash-based pseudorandom keystream. Expanding a short
102
+ key into a long output does not provide the information-theoretic security of a
103
+ true OTP. Using standard SHA-256 does not establish the security of the whole
104
+ construction. Keystream generation followed by XOR also appears in
105
+ [ChaCha20](https://www.rfc-editor.org/rfc/rfc8439.html#section-2.4), but Boho is a
106
+ separate custom construction.
107
+
108
+ XOR alone does not detect tampering. Boho data packets also contain a verification
109
+ tag: the first eight bytes of `SHA256(K || salt12 || plaintext)`. Despite the
110
+ legacy `HMAC` names in the code, this tag is not standard HMAC. Receivers must use
111
+ data only after decryption and tag verification succeed.
112
+
113
+ ### Comparing with TLS
114
+
115
+ Typical certificate-based TLS authenticates peers and establishes keys without
116
+ requiring a previously shared secret, then protects application data with
117
+ symmetric encryption. Web services therefore do not need to distribute a secret
118
+ to each visitor in advance. Even users who have not logged in can authenticate a
119
+ server and establish an encrypted connection; this does not imply network
120
+ anonymity.
121
+
122
+ For small embedded projects, certificate chains, trust roots, validity and clock
123
+ management, renewal, handshake work and buffers can be burdensome. Costs include
124
+ code size, memory, power and operating time, not just certificate purchases.
125
+ Systems that can already provision keys securely may be able to omit some of
126
+ this machinery.
127
+
128
+ However, **TLS also supports PSK-only and PSK with (EC)DHE**, so it should not be
129
+ described as always requiring public-key exchange and third-party certificates.
130
+ [TLS 1.3 pre-shared keys](https://www.rfc-editor.org/rfc/rfc8446.html#section-2.2)
131
+
132
+ Boho's lightweight goal is to provide application-packet protection and shared-key
133
+ authentication without public-key operations or certificate handling in its
134
+ construction. This does not mean it is faster or uses less memory than every TLS
135
+ or standard symmetric implementation; actual comparisons require measurement.
136
+
137
+ ### Arduino, web apps and IOSignal
138
+
139
+ Boho's Arduino and JavaScript implementations exchange encrypted packets between
140
+ DIY devices, Node.js servers and browser apps. Boho handles encryption and
141
+ authentication, while [IOSignal](https://github.com/remocons/iosignal) and
142
+ [IOSignal for Arduino](https://github.com/remocons/iosignal-arduino) handle
143
+ connections and message delivery.
144
+
145
+ Connection credentials and end-to-end (E2E) data keys serve different purposes.
146
+ To keep the body confidential from a relay, only the final endpoints should hold
147
+ its separate data key. Ordinary connection encryption is not automatically E2E,
148
+ and E2E does not hide all routing information or traffic sizes.
149
+
150
+ Modified web app code can expose keys and plaintext, so normal web deployments
151
+ can use HTTPS/WSS alongside Boho. Boho does not bypass browser mixed content
152
+ rules, and E2E still requires trust in the provider of the web app code.
153
+
154
+ ### Conditions to check when applying Boho
155
+
156
+ - Use strong random keys. A single SHA-256 in `set_key` is not a slow password KDF.
157
+ - JavaScript uses `crypto.getRandomValues()`, but Arduino currently uses `micros()` for standalone-packet nonces and the authentication client nonce. This is not a cryptographic random source; consider repeated key/`salt12` combinations across restarts, devices and communication directions.
158
+ - A valid tag alone does not prove that a message is new. The caller manages challenge expiry, replay rejection, ordering and permission to execute commands.
159
+ - Boho is a custom protocol. Do not assume standard AEAD/TLS guarantees or forward secrecy protecting past traffic after a long-term key leak.
10
160
 
11
161
  ---
12
162
 
13
- ## 주요 기능
14
- - 범용 암호화 및 복호화
15
- - 상호 인증 프로토콜 (아래 참조)
16
- - 인증 후 보안 통신
17
- - 종단간(End-to-End) 대칭 암호화
18
- - TypeScript 타입 정의 포함
19
- - JavaScript (Node.js, 브라우저) 및 C/C++ (Arduino) 지원
163
+ ## Features
164
+
165
+ - General-purpose encryption and decryption
166
+ - Mutual authentication protocol (see below)
167
+ - Encrypted communication after authentication
168
+ - End-to-end symmetric encryption
169
+ - TypeScript declarations
170
+ - JavaScript (Node.js, browsers) and C/C++ (Arduino) implementations
20
171
 
21
172
  ---
22
173
 
23
- ## 라이브러리
24
- - **JavaScript:** Node.js, 웹 브라우저 ([GitHub](https://github.com/remocons/boho))
174
+ ## Libraries
175
+
176
+ - **JavaScript:** Node.js and browsers ([GitHub](https://github.com/remocons/boho))
25
177
  - **C/C++:** Arduino ([GitHub](https://github.com/remocons/boho-arduino))
26
178
 
27
179
  ---
28
180
 
29
- ## 대표적인 사용 사례
30
- - WebSocket 인증 및 보안 메시징
31
- - 보안 TCP/직렬/스트림 통신
32
- - 보안 MQTT 페이로드
33
- - 로컬 파일 암호화
181
+ ## Typical use cases
182
+
183
+ - WebSocket authentication and encrypted messaging
184
+ - Encrypted TCP, serial and stream communication
185
+ - Encrypted MQTT payloads
186
+ - Local file encryption
34
187
 
35
188
  ---
36
189
 
37
- ## 주요 API
38
- - `encryptPack`, `decryptPack`: 범용 암호화/복호화
39
- - `encrypt_488`, `decrypt_488`: 인증 후 보안 통신
40
- - `encrypt_e2e`, `decrypt_e2e`: 종단간 암호화
41
- - `RAND(size)`: 안전한 랜덤 버퍼 생성
42
- - `sha256.hash`, `sha256.hex`, `sha256.base64`, `sha256.hmac`: 해싱 유틸리티
190
+ ## Main APIs
191
+
192
+ - `encryptPack`, `decryptPack`: general-purpose encryption and decryption
193
+ - `encrypt_488`, `decrypt_488`: encrypted communication after authentication
194
+ - `encrypt_e2e`, `decrypt_e2e`: end-to-end encryption
195
+ - `RAND(size)`: cryptographically secure random buffer generation
196
+ - `sha256.hash`, `sha256.hex`, `sha256.base64`, `sha256.hmac`: hashing utilities
43
197
 
44
198
  ---
45
199
 
46
- ## 인증 프로토콜 (요약)
200
+ ## Authentication protocol overview
47
201
 
48
- boho 라이브러리의 서버-클라이언트 인증(AUTH) 프로세스는 다음과 같은 단계로 이루어집니다.
202
+ The Boho client–server authentication (AUTH) exchange follows these steps.
49
203
 
50
204
  ---
51
205
 
52
- ### 1. 서버 → 클라이언트: SERVER_TIME_NONCE
53
- - 서버는 현재 시각(초/밀리초)과 랜덤 nonce를 포함한 `SERVER_TIME_NONCE` 메시지를 클라이언트에 보냅니다.
54
- - 메시지 타입: `BohoMsg.SERVER_TIME_NONCE`
55
- - 내용: unixTime, milTime, nonce
206
+ ### 1. Server → client: SERVER_TIME_NONCE
207
+
208
+ - The server sends `SERVER_TIME_NONCE` containing the current time (seconds/milliseconds) and a random nonce.
209
+ - Message type: `BohoMsg.SERVER_TIME_NONCE`
210
+ - Contents: unixTime, milTime, nonce
211
+
212
+ ### 2. Client → server: AUTH_REQ
56
213
 
57
- ### 2. 클라이언트 → 서버: AUTH_REQ
58
- - 클라이언트는 서버로부터 받은 nonce와 시각 정보를 바탕으로 salt12를 생성하고, 자신의 랜덤 nonce를 새로 만듭니다.
59
- - salt12와 자신의 nonce를 합쳐 인증 태그를 생성한 뒤, `AUTH_REQ` 메시지로 서버에 전송합니다.
60
- - 메시지 타입: `BohoMsg.AUTH_REQ`
61
- - 내용: id8, clientNonce, hmac32
214
+ - The client constructs salt12 from the server's nonce and time, and creates its own nonce. JavaScript uses a random nonce; Arduino currently uses `micros()`.
215
+ - It computes an authentication tag using salt12 and its nonce, then sends `AUTH_REQ`.
216
+ - Message type: `BohoMsg.AUTH_REQ`
217
+ - Contents: id8, clientNonce, hmac32
62
218
 
63
- ### 3. 서버: AUTH_REQ 검증 및 응답
64
- - 서버는 클라이언트의 인증 태그가 올바른지 검증합니다.
65
- - 검증 성공 시, 서버는 자신의 인증 태그를 생성하여 `AUTH_RES` 메시지로 클라이언트에 응답합니다.
66
- - 실패 시, `AUTH_FAIL` 메시지를 보낼 수 있습니다.
219
+ ### 3. Server: verify AUTH_REQ and respond
67
220
 
68
- ### 4. 클라이언트: AUTH_RES 검증
69
- - 클라이언트는 서버의 `AUTH_RES` 메시지에 포함된 인증 태그가 올바른지 검증합니다.
70
- - 검증이 성공하면, 양쪽 모두 `isAuthorized = true` 상태가 되어 이후 암호화 통신이 가능합니다.
221
+ - The server verifies the client's authentication tag.
222
+ - On success, it generates its own tag and returns `AUTH_RES`.
223
+ - On failure, it may send `AUTH_FAIL`.
224
+
225
+ ### 4. Client: verify AUTH_RES
226
+
227
+ - The client verifies the authentication tag in `AUTH_RES`.
228
+ - Once verification succeeds, both peers have `isAuthorized = true` and can exchange encrypted messages.
71
229
 
72
230
  ---
73
231
 
74
- ### 메시지 플로우 요약
232
+ ### Message flow
75
233
 
76
234
  ```mermaid
77
235
  sequenceDiagram
@@ -86,36 +244,39 @@ sequenceDiagram
86
244
 
87
245
  ---
88
246
 
89
- ### 각 단계의 목적
247
+ ### Purpose of each step
90
248
 
91
- - **SERVER_TIME_NONCE**: 서버가 연결별 challenge를 제공하고, 사용 수명과 재사용 정책은 호출 측이 관리
92
- - **AUTH_REQ**: 클라이언트가 서버의 정보를 바탕으로 인증 태그 생성(서버가 검증)
93
- - **AUTH_RES**: 서버가 클라이언트의 인증 성공을 알리고, 클라이언트는 서버의 인증 태그 검증 상호 인증
94
- - **AUTH_FAIL**: 인증 실패 시 서버가 전송
249
+ - **SERVER_TIME_NONCE**: provides a per-connection server challenge; the caller manages its lifetime and reuse policy.
250
+ - **AUTH_REQ**: the client generates an authentication tag from the server's information for server verification.
251
+ - **AUTH_RES**: the server responds after verifying the client; the client verifies the server's tag for mutual authentication.
252
+ - **AUTH_FAIL**: the server sends this on authentication failure.
95
253
 
96
254
  ---
97
255
 
98
- ### 특징 및 보안성
256
+ ### Properties and security scope
99
257
 
100
- - 인증은 서버가 보관한 challenge 값에 대해 검증합니다. challenge의 만료·재사용 제한, 인증 시도 제한 및 최종 접속 승인은 iosignal 등 호출 측에서 관리합니다.
101
- - 인증 태그 기반 상호 인증으로, 키를 노출하지 않고 인증 가능
102
- - `ENC_488`은 양측 인증 후 사용합니다. `ENC_PACK`과 E2E는 별도의 사전 인증 없이 명시적으로 설정한 키로 동작합니다.
258
+ - Authentication verifies against the challenge stored by the server. Challenge expiry and reuse restrictions, attempt limits and final connection approval belong to the caller, such as IOSignal.
259
+ - Tag-based mutual authentication avoids transmitting the key itself.
260
+ - `ENC_488` is used after mutual authentication. `ENC_PACK` and E2E operate with an explicitly configured key without requiring a prior authentication exchange.
103
261
 
104
262
  ---
105
263
 
106
- boho의 인증 프로토콜은 서버와 클라이언트가 nonce와 시각 정보를 교환하고, 인증 태그를 통해 상호 인증하는 구조입니다. 이후 인증된 세션에서 암호화 메시지를 교환합니다.
264
+ Boho exchanges nonces and time information between the server and client, then
265
+ uses authentication tags for mutual authentication. The authenticated session can
266
+ subsequently exchange encrypted messages.
107
267
 
108
268
  ---
109
269
 
110
- ## 사용 예제
270
+ ## Usage example
271
+
272
+ ### General-purpose encryption and decryption
111
273
 
112
- ### 일반 데이터 암호화 및 복호화
113
274
  ```js
114
275
  import Boho from 'boho'
115
276
 
116
277
  let boho = new Boho()
117
278
 
118
- // 실제 통신에서는 상대와 안전하게 공유한 무작위 키를 사용합니다.
279
+ // In real communication, use a random key securely shared with the peer.
119
280
  boho.set_key(Boho.RAND(32))
120
281
 
121
282
  let data = 'aaaaaaaa'
@@ -133,43 +294,63 @@ import Boho from 'boho'
133
294
 
134
295
  function printMessage(data){
135
296
  let dataStr = new TextDecoder().decode( data )
136
- console.log('
137
- result string:',dataStr)
297
+ console.log('\n result string:',dataStr)
138
298
  }
139
299
 
140
300
  ```
141
301
 
142
- ### Boho를 사용한 인증 및 보안 통신 예제는 `IOSignal`을 참고하세요.
302
+ ### Authentication and encrypted communication examples
303
+
304
+ See `IOSignal` and the authentication example:
305
+
143
306
  - `iosignal` ([GitHub](https://github.com/remocons/iosignal))
144
307
  - test/AUTH_process.js
145
308
 
146
309
  ---
147
310
 
148
- ## TypeScript 지원
149
- 기본 export인 `Boho` 클래스와 `Boho.RAND`, `Boho.Buffer`, `Boho.MBP` 등의 정적 속성에 타입 정의를 제공합니다. `import Boho from 'boho'`를 사용하세요. `import { Boho, RAND } from 'boho'` 형태의 값 export는 제공하지 않습니다.
311
+ ## TypeScript support
312
+
313
+ Declarations cover the default-exported `Boho` class and static properties such
314
+ as `Boho.RAND`, `Boho.Buffer` and `Boho.MBP`. Use `import Boho from 'boho'`.
315
+ Named value exports such as `import { Boho, RAND } from 'boho'` are not provided.
150
316
 
151
- ## 수신 정책과 보안 범위
317
+ ## Receive policy and security scope
152
318
 
153
- - 내부 메서드 이름의 `HMAC`과 패킷 필드의 `hmac`은 호환성을 위한 기존 이름입니다. 실제 프로토콜 태그는 `SHA256(내부 키 || salt || 데이터)`이며, 표준 HMAC이 아닙니다. 유틸리티 `Boho.sha256.hmac(key, data)`는 표준 HMAC입니다.
154
- - `set_key`는 비어 있지 않은 키를 요구합니다. 키 미설정 상태의 `encryptPack`은 예외를 발생시키며, `clearAuth`는 키도 삭제합니다. `copy_key`는 정확히 32바이트만 허용합니다.
155
- - Boho는 중복 수신 캐시나 인증 단계 제한을 강제하지 않습니다. `ENC_488`의 중복·순서·시간 신선도 검사, challenge 만료 및 접속 상태 관리는 iosignal 등 호출 측 책임입니다. 인증 태그가 유효하다는 사실만으로 새 메시지임을 보장하지 않습니다.
156
- - `set_key`/`copy_key`는 기존 `isAuthorized`를 자동 변경하지 않습니다. 재인증·키 교체·종료 시 호출 측이 상태를 명시적으로 관리해야 합니다.
157
- - JS 송신은 시계가 뒤로 이동하거나 카운터가 같은 밀리초 안에 순환해도 값이 증가하도록 유지합니다. 수신은 기존 Arduino의 시간 보정·카운터 순환을 허용하며 수신 이력 정책을 적용하지 않습니다.
158
- - `ENC_PACK`과 E2E는 독립 메시지/저장 데이터용이며 반복 복호화를 허용합니다. 이 API의 재전송 검출은 호출 측 책임입니다.
159
- - 잘린 패킷, 잘못된 유형/길이, 검증값 불일치는 복호화 시 `undefined`로 거부합니다. `ENC_PACK`/`ENC_488`은 추가 바이트도 거부합니다. iosignal의 `ENC_E2E`는 예외로, 선언된 길이의 라우팅 헤더만 복호화하고 뒤의 E2E 본문은 전달 계층이 보존합니다. 이 본문의 검증은 최종 수신자의 `decrypt_e2e`가 담당합니다.
160
- - 짧은 비밀번호를 위한 느린 KDF, 순방향 비밀성, E2E 키 배포는 제공하지 않습니다. nonce 및 태그 크기를 포함한 암호 설계 개선은 새 프로토콜 버전에서 다뤄야 합니다.
319
+ - Internal `HMAC` names and packet `hmac` fields are retained for compatibility. Protocol tags actually use `SHA256(internal key || salt || data)`, not standard HMAC. The utility `Boho.sha256.hmac(key, data)` is standard HMAC.
320
+ - `set_key` requires a nonempty key. `encryptPack` throws if no key is configured, and `clearAuth` also clears the key. `copy_key` accepts exactly 32 bytes.
321
+ - Boho does not enforce a duplicate-receive cache or authentication-stage restrictions. Duplicate, ordering and freshness checks for `ENC_488`, challenge expiry and connection state belong to the caller, such as IOSignal. A valid tag alone does not prove freshness.
322
+ - `set_key`/`copy_key` do not automatically change `isAuthorized`. The caller must explicitly manage state during reauthentication, key changes and shutdown.
323
+ - JS sending maintains increasing clock/counter values even if the clock moves backward or the counter wraps within the same millisecond. Receiving permits existing Arduino clock adjustments and counter wrapping, without enforcing receive-history policy.
324
+ - `ENC_PACK` and E2E support independent messages and stored data, permitting repeated decryption. Replay detection for these APIs belongs to the caller.
325
+ - Decryption rejects truncated packets, invalid types/lengths and tag mismatches with `undefined`. `ENC_PACK`/`ENC_488` also reject extra bytes. IOSignal's `ENC_E2E` is an exception: only the routing header of the declared length is decrypted, and the delivery layer preserves the trailing E2E body. The final recipient verifies that body with `decrypt_e2e`.
326
+ - A slow KDF for short passwords, forward secrecy and E2E key distribution are not provided. Cryptographic design changes, including nonce and tag sizes, require a new protocol version.
161
327
 
162
- ## 개발 검증
328
+ ## Development checks
163
329
 
164
- `npm test`는 배포 파일을 먼저 재빌드하고, 소스·ESM·브라우저 UMD(Node VM)의 회귀 테스트와 TypeScript 검사를 수행합니다. 실제 브라우저 및 물리 Arduino 장치 검사는 별도입니다.
330
+ Open the [browser test page on GitHub Pages](https://remocons.github.io/boho/test-browser/) to run the random generation, encryption/decryption and authentication tests in your browser. Tests run automatically when the page loads.
165
331
 
166
- `npm run test:arduino`는 인접한 `../boho-arduino/src/Boho.cpp`를 수정 없이 호스트 C++ 컴파일러로 빌드해 JS와 양방향 통신을 검증합니다. 다른 위치는 `BOHO_ARDUINO_PATH` 환경 변수로 지정하세요. macOS는 CommonCrypto, 다른 호스트는 OpenSSL 개발 라이브러리가 필요합니다. 테스트용 시계·Serial·SHA-256 어댑터를 사용하므로 물리 장치 테스트를 대체하지 않습니다.
332
+ `npm test` first rebuilds distribution files, then runs regression tests for the
333
+ source, ESM and browser UMD (in a Node VM), plus TypeScript checks. Actual browser
334
+ and physical Arduino tests are separate.
167
335
 
168
- `npm run test:iosignal`은 인접한 `../iosignal` 및 `../iosignal-arduino`의 실제 소스를 사용합니다. 수정 Boho를 JS 서버와 클라이언트에 로더로 주입하고, Arduino IOSignal의 80바이트 RX 버퍼와 메모리 전송 계층으로 인증·일반 통신·E2EE 양방향 경로를 검사합니다. `IOSIGNAL_PATH`, `IOSIGNAL_ARDUINO_PATH`로 경로를 지정할 수 있습니다. 실제 AVR의 SRAM 사용량이나 물리 네트워크를 검증하는 테스트는 아닙니다.
336
+ `npm run test:arduino` compiles the adjacent `../boho-arduino/src/Boho.cpp`
337
+ unchanged with a host C++ compiler and checks bidirectional JS communication.
338
+ Set `BOHO_ARDUINO_PATH` for a different location. macOS uses CommonCrypto; other
339
+ hosts need OpenSSL development libraries. Test clock, Serial and SHA-256 adapters
340
+ mean this does not replace physical device tests.
169
341
 
170
- 오류 목록과 호환성 영향은 [수정 내역](docs/SECURITY_FIXES.md)을 참고하세요.
342
+ `npm run test:iosignal` uses the actual sources in adjacent `../iosignal` and
343
+ `../iosignal-arduino`. A loader injects the modified Boho into the JS server and
344
+ client, and tests authentication plus ordinary/E2EE traffic in both directions
345
+ using Arduino IOSignal's 80-byte RX buffer and an in-memory transport.
346
+ `IOSIGNAL_PATH` and `IOSIGNAL_ARDUINO_PATH` override those locations. This does not
347
+ test actual AVR SRAM usage or physical networking.
348
+
349
+ See [security fixes](docs/SECURITY_FIXES.md) for the issue list and compatibility
350
+ impact.
171
351
 
172
352
  ---
173
353
 
174
- ## 라이선스
354
+ ## License
355
+
175
356
  MIT