<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Wasith T. (Bai-Phai) on Medium]]></title>
        <description><![CDATA[Stories by Wasith T. (Bai-Phai) on Medium]]></description>
        <link>https://medium.com/@phai?source=rss-98dd8ab123b0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*yy4aLTADrZgzSNCQ.</url>
            <title>Stories by Wasith T. (Bai-Phai) on Medium</title>
            <link>https://medium.com/@phai?source=rss-98dd8ab123b0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 23:43:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@phai/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Efficiently Clone All Repositories from a Specific Bitbucket Project]]></title>
            <link>https://medium.com/@phai/clone-all-repos-from-the-specific-project-from-bitbucket-2aaf21507d56?source=rss-98dd8ab123b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/2aaf21507d56</guid>
            <category><![CDATA[git-clone]]></category>
            <category><![CDATA[bitbucket]]></category>
            <category><![CDATA[onboarding]]></category>
            <dc:creator><![CDATA[Wasith T. (Bai-Phai)]]></dc:creator>
            <pubDate>Sat, 07 Oct 2023 13:37:39 GMT</pubDate>
            <atom:updated>2023-10-07T14:40:46.093Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vvLAom2CFgNVR4UFaKv_9A.png" /></figure><p>ดึงทุก ​repo จาก bitbucket โดยระบุ project</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ecf8d6c9349393aa5d784f4179abb740/href">https://medium.com/media/ecf8d6c9349393aa5d784f4179abb740/href</a></iframe><p>Save the code above to a file named as `clone-all-repos.sh` then</p><pre># to mark it as executable<br>chmod +x clone-all-repos.sh<br># then run it<br>./clone-all-repos.sh</pre><p>หรือไม่ก็ทำ <a href="https://www.google.com/search?q=Monorepo">monorepo</a> ซะ</p><p>อันนี้ medium หรือ pastebin นะ 🤣</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2aaf21507d56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ช่วงนี้ย้ายไปเขียนที่ dev.to]]></title>
            <link>https://medium.com/@phai/%E0%B8%8A%E0%B9%88%E0%B8%A7%E0%B8%87%E0%B8%99%E0%B8%B5%E0%B9%89%E0%B8%A2%E0%B9%89%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%9B%E0%B9%80%E0%B8%82%E0%B8%B5%E0%B8%A2%E0%B8%99%E0%B8%97%E0%B8%B5%E0%B9%88-dev-to-326ae0cbaff9?source=rss-98dd8ab123b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/326ae0cbaff9</guid>
            <category><![CDATA[blog]]></category>
            <category><![CDATA[migration]]></category>
            <dc:creator><![CDATA[Wasith T. (Bai-Phai)]]></dc:creator>
            <pubDate>Wed, 20 May 2020 01:36:13 GMT</pubDate>
            <atom:updated>2020-05-20T01:36:13.790Z</atom:updated>
            <content:encoded><![CDATA[<p>ซึ่งสามารถติดตามได้ที่ <a href="https://dev.to/ph9">https://dev.to/ph9</a></p><p>สำหรับตอนนี้เพิ่งเริ่มได้ 4 บทความผมเรียงจากล่าสุดแล้วกันครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5IW8lgXm-8CGGohl5wsZIA.png" /></figure><ul><li>Folding@home โปรเจค<strong>ช่วยประมวล</strong>ผลเพื่อต่อสู้ <strong>COVID-19!</strong> — <a href="https://dev.to/ph9/folding-home-covid-19-1j07">https://dev.to/ph9/folding-home-covid-19-1j07</a></li><li><strong>ลง Xcode</strong> และ iOS simulators <strong>ผ่าน command-line</strong> เพื่อทำ script อัตโนมัติ — <a href="https://dev.to/ph9/xcode-ios-simulators-command-line-xcode-version-4i64">https://dev.to/ph9/xcode-ios-simulators-command-line-xcode-version-4i64</a></li><li>มาตรวจดูกันว่าโปรเจค <strong>Android, iOS project เราปลอดภัย</strong>แค่ไหนด้วย <strong>MobSF</strong> — <a href="https://dev.to/ph9/android-ios-project-mobsf-3l4n">https://dev.to/ph9/android-ios-project-mobsf-3l4n</a></li><li>มาตรวจดูกันว่า <strong>iOS Project</strong> เรา<strong>ใช้ dependencies อะไรที่เป็นอันราย</strong>หรือไม่ด้วย <strong>OWASP Dependency-Check</strong> — <a href="https://dev.to/ph9/ios-project-dependencies-owasp-dependency-check-54lj">https://dev.to/ph9/ios-project-dependencies-owasp-dependency-check-54lj</a></li></ul><p><strong>สวัสดีครับ</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=326ae0cbaff9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[จะลบบางอย่างออกจาก log เช่น password เพราะไม่อยากให้เห็น และควรเก็บไว้]]></title>
            <link>https://medium.com/gucodelive/%E0%B8%88%E0%B8%B0%E0%B8%A5%E0%B8%9A%E0%B8%9A%E0%B8%B2%E0%B8%87%E0%B8%AD%E0%B8%A2%E0%B9%88%E0%B8%B2%E0%B8%87%E0%B8%AD%E0%B8%AD%E0%B8%81%E0%B8%88%E0%B8%B2%E0%B8%81-log-%E0%B9%80%E0%B8%8A%E0%B9%88%E0%B8%99-password-%E0%B9%80%E0%B8%9E%E0%B8%A3%E0%B8%B2%E0%B8%B0%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B8%A2%E0%B8%B2%E0%B8%81%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B9%80%E0%B8%AB%E0%B9%87%E0%B8%99-%E0%B9%81%E0%B8%A5%E0%B8%B0%E0%B8%84%E0%B8%A7%E0%B8%A3%E0%B9%80%E0%B8%81%E0%B9%87%E0%B8%9A%E0%B9%84%E0%B8%A7%E0%B9%89-bbec9d095a47?source=rss-98dd8ab123b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbec9d095a47</guid>
            <category><![CDATA[logging]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Wasith T. (Bai-Phai)]]></dc:creator>
            <pubDate>Sun, 08 Mar 2020 12:24:10 GMT</pubDate>
            <atom:updated>2020-03-08T12:45:35.696Z</atom:updated>
            <content:encoded><![CDATA[<h3>[Kotlin, Spring Boot] จะลบบางอย่างออกจาก log เช่น password, token เพราะไม่อยากให้เห็น และไม่ควรเก็บไว้</h3><p>มันเกิดจากอุบัติเหตุในการหาวิธีการของ blog ที่แล้ว ที่มีความต้องการจะเข้าหรัาแค่บางส่วน และอยากรู้ว่าเราจะเอาออกได้ไหมเผื่อมี member หรือ properties ที่ไม่ต้องการเก็บไว้เช่น password, token</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T9aVdiePURFn8Ge2cKioeQ.png" /><figcaption>genact — A nonsense activity generator, <a href="https://github.com/svenstaro/genact">https://github.com/svenstaro/genact</a></figcaption></figure><p>ย้อนกลับไปอ่าน blog ก่อนหน้า <a href="https://medium.com/@phai/1644d6c0f2fc">https://medium.com/@phai/1644d6c0f2fc</a> เพราะบางเรื่องไม่ได้เขียนซ้ำใน blog นี้</p><p><a href="https://medium.com/gucodelive/jsonview-%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA%E0%B9%81%E0%B8%84%E0%B9%88%E0%B8%9A%E0%B8%B2%E0%B8%87%E0%B8%95%E0%B8%B1%E0%B8%A7%E0%B9%83%E0%B8%99-object-kotlin-java-spring-boot-1644d6c0f2fc">JsonView กับการเข้ารหัสแค่บางตัวใน object (Kotlin, Java, Spring Boot)</a></p><h4>Implement</h4><p>จากตอนแรกที่เรามีแค่ Views.Secure ที่ไว้ระบุว่า properties ต่อไปนี้เราจะเข้ารหัา วันนี้เรามาเพิ่ม Views.Secret แยกกันให้ดีนะชื่อคล้ายกันมาก Secure, Secret</p><pre>seal class Views {<br>  seal class Secure<br>  seal class Secret<br>}</pre><p>แล้วก็ไปใส่ไว้ที่ field นั้น ๆ ว่า @JsonView(Views.Secret::class)</p><pre>data class Login {</pre><pre>  val username: String<br>  @JsonView(Views.Secret::class)<br>  val password: String<br>}</pre><p>ไปดูที่ configs จะเห็นว่าสั่งให้เขียนแค่ Views.Secure ไว้เท่านั้น เพราะฉะนั้น JsonView ตัวอื่น ๆ ก็จะไม่ถูกเขียนลง log</p><pre>@Configuration<br>class SecureWriterConfig {</pre><pre>  @Bean<br>  fun secureWriter(mapper: ObjectMapper): ObjectWriter {<br>    return mapper<br>      .writerWithView(Views.Secure::class.java)<br>  }<br>}</pre><p>เท่านี้อะไรที่ไม่ควรลง log เช่น token, password ก็หายออกไปจาก log แล้ว หรือถ้าต้องการ override เป็นค่าว่าง ก็ทำได้ที่ JsonSerializer เช่นกัน</p><pre>class SecretJsonSerializer: JsonSerializer&lt;String&gt;() {<br><br>  override fun serialize(<br>    value: String,<br>    gen: JsonGenerator,<br>    provider: SerializerProvider<br>  ) {<br>    if (provider.<em>activeView </em>== Views.Secret::class.<em>java</em>) {<br>      gen.writeString(&quot;ไม่ให้ดูหรอก ความลับลูกค้า&quot;)<br>    } else {<br>      gen.writeString(value)<br>    }<br>  }<br>}</pre><p>เป็นอย่างไรกันบ้างครับ อย่าลืมตรวจเชคดีว่า เรา log สิ่งไม่ควร log หรือไม่</p><h4>ข่าวที่เกี่ยวข้อง</h4><p>แต่อย่ากังวลไป ทั้ง Facebook, และ Twitter ก็เคยทำพลาดจุดนี้มาแล้ว</p><ul><li><a href="https://www.blognone.com/node/102011">Twitter พบบั๊กล็อกภายในเก็บรหัสผ่านโดยไม่ได้ hash แนะนำผู้ใช้ทุกคนให้เปลี่ยนรหัสผ่าน</a></li><li><a href="https://www.blognone.com/node/108782">เฟซบุ๊กพบผู้ใช้บางส่วนถูกเก็บรหัสผ่านแบบไม่เข้ารหัส พนักงานเข้าดูได้ กระทบนับร้อยล้านบัญชี</a></li></ul><p>ถ้าเราเจอแบบนี้ในระบบให้ทำการปิดช่องโหว่นี้ ลบส่วนที่ไม่ควรจะเก็บออกไป และทำการแจ้งผู้ใช้งานให้ทรายถึงผลกระทบ และแนะนำให้ผู้ใช้งานเปลี่ยนรหัสผ่านด้วย</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbec9d095a47" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gucodelive/%E0%B8%88%E0%B8%B0%E0%B8%A5%E0%B8%9A%E0%B8%9A%E0%B8%B2%E0%B8%87%E0%B8%AD%E0%B8%A2%E0%B9%88%E0%B8%B2%E0%B8%87%E0%B8%AD%E0%B8%AD%E0%B8%81%E0%B8%88%E0%B8%B2%E0%B8%81-log-%E0%B9%80%E0%B8%8A%E0%B9%88%E0%B8%99-password-%E0%B9%80%E0%B8%9E%E0%B8%A3%E0%B8%B2%E0%B8%B0%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B8%A2%E0%B8%B2%E0%B8%81%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B9%80%E0%B8%AB%E0%B9%87%E0%B8%99-%E0%B9%81%E0%B8%A5%E0%B8%B0%E0%B8%84%E0%B8%A7%E0%B8%A3%E0%B9%80%E0%B8%81%E0%B9%87%E0%B8%9A%E0%B9%84%E0%B8%A7%E0%B9%89-bbec9d095a47">จะลบบางอย่างออกจาก log เช่น password เพราะไม่อยากให้เห็น และควรเก็บไว้</a> was originally published in <a href="https://medium.com/gucodelive">กูโค้ด</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JsonView กับการเข้ารหัสแค่บางตัวใน object (Kotlin, Java, Spring Boot)]]></title>
            <link>https://medium.com/gucodelive/jsonview-%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA%E0%B9%81%E0%B8%84%E0%B9%88%E0%B8%9A%E0%B8%B2%E0%B8%87%E0%B8%95%E0%B8%B1%E0%B8%A7%E0%B9%83%E0%B8%99-object-kotlin-java-spring-boot-1644d6c0f2fc?source=rss-98dd8ab123b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/1644d6c0f2fc</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[logging]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Wasith T. (Bai-Phai)]]></dc:creator>
            <pubDate>Sun, 08 Mar 2020 09:22:29 GMT</pubDate>
            <atom:updated>2020-03-08T12:25:48.697Z</atom:updated>
            <content:encoded><![CDATA[<p>เรื่องมีอยู่ว่าเราอยากได้ body ของ log ที่เข้ารหัสข้อมูลแค่บางส่วนเท่านั้น แล้วเราจะทำยังไงไปดู</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R3s2mAIViQhKqchbS3dwdw.png" /></figure><p><strong>ตัวอย่างของ object ต้นฉบับ</strong></p><pre>{<br>  customerId: 100,<br>  customerName: &quot;นายวสิฐ​ ธีรภัทรธำรง&quot;<br>}</pre><p><strong>ตัวอย่างของ object ใน log</strong></p><pre>{<br>  customerId: 100,<br>  customerName: &quot;{ThisTextWasEncryptedYouShouldNotAbleToRead}&quot;<br>}</pre><h4>Complexity</h4><p>ในตอนแรกเราก็คิดว่าจะวนหา key ที่ match ทุกตัว แต่ผลที่มันออกมาก็ n1*n1 เลยทีเดียว โดยที่ n1 คือจำนวนของ key ที่ระบุไว้ และ n2 คือจำนวนของ key ใน object</p><p>ซ้ำร้ายถ้าสมมุติว่าถ้า object อยู่ในอีกรูปแบบเช่น</p><pre>customer: {<br>  id: 100,<br>  name: &quot;Mr.Wasith Theerapattrathamrong&quot;<br>}</pre><p>หรือ</p><pre>customers: [<br>  {<br>    id: 100,<br>    name: &quot;ใครก็ได้&quot;<br>  }<br>]</pre><p>เราก็จำเป็นต้องเพิ่ม key เท่าไปในฐานข้อมูลให้มันยาก ๆ ขึ้นอีกเช่น</p><ul><li>cusomter.name</li><li>customerName</li></ul><p>หรืออะไรก็ได้ที่เป็นเหตุจะให้ match กันได้ แน่นอนว่ายากมาก</p><h4>ตัวอย่างการ implement</h4><p>โดย libraries ที่ใช้มีดังนี้</p><pre>import com.fasterxml.jackson.core.JsonGenerator<br>import com.fasterxml.jackson.databind.JsonSerializer<br>import com.fasterxml.jackson.databind.SerializerProvider</pre><p>เริ่มจากประกาศ class เปล่า ๆ ที่จะมาใช้บอกว่าตัวไหนที่จะให้เข้ารหัส</p><pre>sealed class Views {<br>  sealed class Secure<br>}</pre><p>ตามด้วย custom JsonSerializer ที่ไว้ระบุว่า Views.Secure จะต้องเข้ารหัสนะ</p><pre>class SecureJsonSerializer(var cryptor: Cryptor) : JsonSerializer&lt;String&gt;() {<br><br>  override fun serialize(value: String, gen: JsonGenerator, provider: SerializerProvider) {<br>    if (provider.<em>activeView </em>== Views.Secure::class.<em>java</em>) {<br>      val encryptedValue = cryptor.encrypt(value)<br>      gen.writeString(encryptedValue)<br>    } else {<br>      gen.writeString(value)<br>    }<br>  }<br>}</pre><p>จากนั้นระบุ JsonView และ JsonSerilize ที่ poperties หรือ member ของ model นั้น ๆ</p><pre>data class Customer {</pre><pre>  val id: UInt</pre><pre>  @JsonView(Views.Secure::class)<br>  @JsonSerialize(using = SecureJsonSerializer::class)<br>  val name: String<br>}</pre><p>และสามารถตั้งค่าเพื่อเพิ่มความสามารถให้ ObjectMapper ได้ด้วย</p><pre>@Configuration<br>class SecureWriterConfig {</pre><pre>  @Bean<br>  fun secureWriter(mapper: ObjectMapper): ObjectWriter {<br>    return mapper<br>      // ต้องการให้เขียนตัวที่ไม่ได้ประกาศ annotation JsonView ด้วย<br>      // สามารรถใส่ไว้ใน application.properties ได้ว่า<br>      // spring.jackson.mapper.default-view-inclusion=true<br>      .enable(MapperFeature.DEFAULT_VIEW_INCLUSION)<br>      // ถ้าไม่ต้องการ pretty json สามารถเอาบรรทัดนี้ออกได้<br>      .enable(SerializationFeature.INDENT_OUTPUT)<br>      .writerWithView(Views.Secure::class.java)<br>  }<br>}</pre><h4><strong>ในตอนใช้งานนั้น</strong></h4><p>ต้องใช้งานผ่าน ObjectWriter</p><pre>@RestController<br>class CustomerController(val service: CustomerService) {<br><br>  @GetMapping(&quot;/customer&quot;)<br>  fun customer(): Customer = service.create()<br><br>}<br><br>@Service<br>class CustomerService(val writer: ObjectWriter) {<br>  fun create() = Customer(100, &quot;ชื่อลูกค้า&quot;)<br>    .also {<br>      log.info(&quot;Get customer {}&quot;, writer.writeValueAsString(it))<br>    }<br><br>  companion object {<br>    private val log: Logger = LoggerFactory.getLogger(CustomerController::class.java)<br>  }<br>}</pre><p>เท่านี้เราก็จะได้ output ที่อยู่ในรูป Json และเข้ารหัสเฉพาะส่วนที่ต้องการได้แล้ว และส่วนที่ return ออกไปหาหน้าบ้านไม่ถูกเข้ารหัสด้วย ถ้าอยากให้ส่วนที่ return ไปหาหน้าบ้านเข้ารหัสด้วยก็สามารถใช้ writer.writeValueAsString(objectที่จะเขียน)</p><p>และด้วยวิธีการนี้จะทำให้ค่า complexity เหลือแค่ n คือจำนวนของ key เท่านั้น</p><h4>ถ้าต้องการออกแบบการเข้ารหัสยังไงให้ปลอดภัย</h4><p>สามารถไปดูย้อนหลังได้ที่ <a href="https://medium.com/@phai/4b96babdd16">https://medium.com/@phai/4b96babdd16</a></p><p><a href="https://medium.com/gucodelive/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%AD%E0%B8%AD%E0%B8%81%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B1%E0%B8%A7%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B9%81%E0%B8%82%E0%B9%87%E0%B8%87%E0%B9%81%E0%B8%81%E0%B8%A3%E0%B9%88%E0%B8%87-4b96babdd16">การออกแบบตัวเข้ารหัสให้แข็งแกร่ง</a></p><h4>What’s next</h4><p>สำหรับบทความต่อไปจะมาบอกว่าเราจะลบของออกจาก log เช่น password ได้อย่างไร — <a href="https://medium.com/@phai/bbec9d095a47">https://medium.com/@phai/bbec9d095a47</a></p><p><a href="https://medium.com/gucodelive/%E0%B8%88%E0%B8%B0%E0%B8%A5%E0%B8%9A%E0%B8%9A%E0%B8%B2%E0%B8%87%E0%B8%AD%E0%B8%A2%E0%B9%88%E0%B8%B2%E0%B8%87%E0%B8%AD%E0%B8%AD%E0%B8%81%E0%B8%88%E0%B8%B2%E0%B8%81-log-%E0%B9%80%E0%B8%8A%E0%B9%88%E0%B8%99-password-%E0%B9%80%E0%B8%9E%E0%B8%A3%E0%B8%B2%E0%B8%B0%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%AD%E0%B8%A2%E0%B8%B2%E0%B8%81%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B9%80%E0%B8%AB%E0%B9%87%E0%B8%99-%E0%B9%81%E0%B8%A5%E0%B8%B0%E0%B8%84%E0%B8%A7%E0%B8%A3%E0%B9%80%E0%B8%81%E0%B9%87%E0%B8%9A%E0%B9%84%E0%B8%A7%E0%B9%89-bbec9d095a47">จะลบบางอย่างออกจาก log เช่น password เพราะไม่อยากให้เห็น และควรเก็บไว้</a></p><p>และจะมาเล่าให้ฟังอีกว่าเขียน log ขาเข้า ขาออกใน Spring Boot ยังไง โดยการ implement ครั้งเดียวและยังใช้การเข้ารหัสด้วยวิธีการข้างบน ไม่ต้องไปสั่งเขียนที่ controller ทุก ๆ api รอติดตามได้เลยครับผม</p><h4>อ้างอิง</h4><ul><li><a href="https://github.com/9tae2013/json-view2">https://github.com/9tae2013/json-view2</a> โดยพี่เต้ <a href="https://www.facebook.com/taemonz">https://fb.me/taemonz</a> ผมยกย่องให้เป็น Living {Kotlin|Java|Spring Boot} documents. ถามอะไรตอบได้ 🤣🤣🤣</li></ul><p><strong>ขอบคุณ</strong></p><ul><li>น้องยุทธ์ <a href="https://www.facebook.com/iBabieTM">https://fb.me/iBabieTM</a></li><li>พี่เก๋ <a href="https://medium.com/@phatpan">https://medium.com/@phatpan</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1644d6c0f2fc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gucodelive/jsonview-%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA%E0%B9%81%E0%B8%84%E0%B9%88%E0%B8%9A%E0%B8%B2%E0%B8%87%E0%B8%95%E0%B8%B1%E0%B8%A7%E0%B9%83%E0%B8%99-object-kotlin-java-spring-boot-1644d6c0f2fc">JsonView กับการเข้ารหัสแค่บางตัวใน object (Kotlin, Java, Spring Boot)</a> was originally published in <a href="https://medium.com/gucodelive">กูโค้ด</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[การออกแบบตัวเข้ารหัสให้แข็งแกร่ง]]></title>
            <link>https://medium.com/gucodelive/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%AD%E0%B8%AD%E0%B8%81%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B1%E0%B8%A7%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B9%81%E0%B8%82%E0%B9%87%E0%B8%87%E0%B9%81%E0%B8%81%E0%B8%A3%E0%B9%88%E0%B8%87-4b96babdd16?source=rss-98dd8ab123b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b96babdd16</guid>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[ea]]></category>
            <category><![CDATA[keys]]></category>
            <category><![CDATA[iv]]></category>
            <dc:creator><![CDATA[Wasith T. (Bai-Phai)]]></dc:creator>
            <pubDate>Mon, 02 Mar 2020 11:19:39 GMT</pubDate>
            <atom:updated>2020-03-08T08:33:06.645Z</atom:updated>
            <content:encoded><![CDATA[<p>สำหรับทุกวันนี้ ถ้าถามว่าใช้อัลกอริทึมอะไรดีในการเข้ารหัส ถ้าเอาง่าย ๆ คงเลือกแบบ AES กัน โดยโค้ดตัวอย่างจะเป็นภาษา Kotlin</p><p>แต่เราเข้ารหัสข้อมูลเหมือน ๆ เดิมด้วย key เดิมซ้ำ ๆ เราก็จะได้ ข้อมูลที่เข้ารหัสแล้วหน้าตาแบบเดิม และนี่อาจทำให้เห็น pattern ของข้อมูลที่เข้ารหัสได้ แต่ว่าถ้าเราใช้ key ใหม่ทุกครั้งก็ข้ามบทความนี้ไปเลย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dh7et23uvyvgbigyAI5Djg.png" /><figcaption><a href="https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_Codebook_(ECB)">https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_Codebook_(ECB)</a></figcaption></figure><p>ไม่ได้พูดถึง mode การเข้ารหัสในบทความนี้ ผมบอกได้แค่ว่า</p><ul><li>บาง mode เน้นเรื่อง performance</li><li>บาง mode สามารถถอดรหัสหลาย ๆ block พร้อม ๆ กันได้</li><li>บาง mode เน้นเรื่องความปลอดภัย</li><li>บาง mode ไม่สามารถถอดรหัส block ต่อ ๆ ไป ได้ถ้า block ก่อน ๆ หน้าพัง</li><li>บาง mode จะสามารถใช้ IV ได้</li><li>และบอกไม่ได้ว่า padding กับ nopadding ต่างกันยังไงนะ 555</li></ul><h4>แล้วทำยังไงให้ไม่เห็น pattern</h4><p><strong>IV (initialization vector)</strong> เป็นวิธีการหนึ่งที่ถูกสร้างมาเพื่อแก้ปัญหาเหล่านี้ ซึ่ง IV ควรจะถูกสร้างใหม่แบบสุ่ม ๆ ทุก ๆ ครั้งที่ใช้งาน หรือทุก ๆ กี่ block ของข้อมูลก็ว่าจะไปซึ่งถ้าจะ implement ให้มันสุ่มทุก n block อาจจะยากไปหน่อย (คนเขียนทำไม่ได้และขี้เกียจ 555) และควรใช้ SecureRandom หรืออะไรก็ได้ที่การสุ่มค่านั้น ๆ ได้มาตรฐานว่าเกิดการสุ่มจริง และถ้า IV ไม่ได้เกิดจากการสุ่มก็ไม่ต่างอะไรกับการเข้ารหัสด้วย AES แบบใช้ key อย่างเดียว</p><pre>fun generateIv(random: SecureRandom): ByteArray {<br>    val key = ByteArray(16)<br>    random.nextBytes(key)<br>    return key<br>}</pre><p>เนื่องจาก key ถูกออกแบบมาให้เป็น private แล้วคือห้ามหลุดไปข้างนอกเด็ดขาด IV จึงยอมให้เป็น public ได้ ซึ่งโดยปกติเราจะแปะ IV ที่ข้อมูลที่เข้ารหัสแล้ว และมักแปะไว้ข้างหน้าของข้อมูลที่เข้ารหัส ทั้งนี้ใครจะออกแบบว่าจะแปะตรงไหนก็แล้วแต่จะตกลงกันเลย</p><pre>fun encrypt(original: ByteArray): ByteArray {<br>  val iv = generateIv()<br>  val aes = AES(key, iv)<br>  val encrypted = aes.encrypt(original)<br>  return iv + encrypted<br>}</pre><p>ซึ่งนั่นแปลว่าการถอด เราต้องแกะ IV ออกมาจากข้อมูลก่อน</p><pre>fun decrypt(encrypted: ByteArray): ByteArray {<br>    val iv = encrypted.<em>sliceArray</em>(0..15)<br>    val encrypted = bytes.<em>sliceArray</em>(16..bytes.<em>lastIndex</em>)<br>    val aes = AES(key, iv)<br>    return aes.decrypt(encrypted)<br>}</pre><h4><strong>การออกแบบ key</strong></h4><p>สมมุติว่าต้องสร้าง key ขนาด 256 bits เรามักจะใช้ string ยาว 32 ตัวอักษร ซึ่งเป็นเรื่องที่ไม่ควร เราไม่ควรใช้แค่ printable characters เพราะจะทำให้ความน่าจะเป็นของ key ลดลงมาก เพราะ non-printable characters จะไม่ถูกรวมในความน่าจะเป็นของ key</p><pre>val key = &quot;!WVPm`RJBa.4Xwo@z_*\&quot;9qj8NbHe LT2&quot;<br>val bytes = key.toByteArray()</pre><p>ให้ดีถ้าต้องเก็บเป็น config และต้องเป็น stirng เท่านั้น อาจจะเก็บเป็น hex code ยาว 64 ตัวอักษร แล้วแปลงเป็น ByteArray แทนจะปลอดภัยกว่า และใช้ความน่าจะเป็นได้ทั้ง 256 bits</p><pre>val key = &quot;AA BB CC DD EE...&quot;<br>val bytes = hexToBytes(key)</pre><h4>เจาะลึกลงไป</h4><p>ว่าทำไมแค่เราเสก key จาก printable characters ให้ครบ 256 bits ไม่พอใช้ ถ้าเราดูตามตาราง ascii</p><ul><li>0-31 และ 127 รวม 33 ตัว เป็น control characters ซึ่งแสดงเป็นตัวอักษรไม่ได้ มันเอาไว้เป็น command ไปหาคอมพิวเตอร์ เช่นเลื่อน cursor สั่งลบตัวอักษรก่อนหน้า ฯลฯ ชุดนี้ไม่นับ</li><li>32–47, 58–64, 91–96, 123-126 รวม 16+7+6+4 = 33 ตัว เป็นอักขระพิเศษ</li><li>48–57 รวม 10 ตัว เป็นตัวเลข 0–9</li><li>65–90 เป็นตัวพิมพ์ใหญ่ รวม 26 ตัว</li><li>97–122 เป็นตัวพิมพ์เล็ก รวม 26 ตัว</li></ul><p>รวมทั้งสิ้น 95 ตัว อักษร นั่นเท่ากับว่า key ที่ยาว 256 bits นั้นจะเท่ากับ log2(95³²) ซึ่งเท่ากับประมาณ 210 bits เท่านั้น</p><p>แล้วถ้าเราออกแบบ key แต่ใช้ พิมพ์เล็ก (26 รูปแบบ) และตัวเลข (10 รูปแปป) จะเท่ากับ log2(36³²) = ประมาณ 165 bits เท่านั้น</p><h4>ปล.</h4><p>เคยมีงานวิจัยบอกว่า dev ทำให้ได้หมดแหละ แต่ขอให้บอก เพราะหลาย ๆ ครั้ง dev ก็ไม่รู้ว่าควรใช้อัลกอลทึมอะไรแบบไหนในการเข้ารหัส ในการสร้าง key หรืออาจจะเลือกหยิบผิดเช่น 3DES ที่เก่าไปแล้ว</p><p>ทั้งนี้ทีม audit และ security ควรจะเข้ามากำกับดูแลตั้งแต่เนิ่น ๆ เพราะของพวกนี้ส่วนใหญ่ทำครั้งเดียวและพอขึ้น production ไปแล้วจะแก้ไขได้ยาก</p><p>ถ้าทำไปแล้ว ก็ migrate ได้ แต่การ migrate ไม่ใช่เรื่องง่ายอยู่แล้ว</p><h4><strong>อ้างอิง</strong></h4><p>… ไม่มีอะ 555 อ่านมานานแล้วหาไม่ได้</p><p>ถ้าผิดโปรดบอก</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b96babdd16" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gucodelive/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%AD%E0%B8%AD%E0%B8%81%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B1%E0%B8%A7%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B9%81%E0%B8%82%E0%B9%87%E0%B8%87%E0%B9%81%E0%B8%81%E0%B8%A3%E0%B9%88%E0%B8%87-4b96babdd16">การออกแบบตัวเข้ารหัสให้แข็งแกร่ง</a> was originally published in <a href="https://medium.com/gucodelive">กูโค้ด</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ค่าคงที่ (constant) ในภาษา Swift]]></title>
            <link>https://medium.com/gucodelive/%E0%B8%84%E0%B9%88%E0%B8%B2%E0%B8%84%E0%B8%87%E0%B8%97%E0%B8%B5%E0%B9%88-constant-%E0%B9%83%E0%B8%99%E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B2-swift-587a3a96270e?source=rss-98dd8ab123b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/587a3a96270e</guid>
            <category><![CDATA[style-guides]]></category>
            <category><![CDATA[enum]]></category>
            <category><![CDATA[constant]]></category>
            <category><![CDATA[coding-style]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Wasith T. (Bai-Phai)]]></dc:creator>
            <pubDate>Mon, 02 Mar 2020 10:01:05 GMT</pubDate>
            <atom:updated>2020-03-08T08:27:06.555Z</atom:updated>
            <content:encoded><![CDATA[<h3>ค่าคงที่ทั่วโลก (global constant) ในภาษา Swift</h3><blockquote>ในภาษา Swift แนะนำว่าให้ประกาศ constant ไว้ใน enum เพราะว่าถ้าประกาศไว้ที่อื่นเช่น class, struct จะทำให้สร้าง object หรือ instance ที่ไม่ได้ใช้งาน หรือถ้าประกาศไว้ลอย ๆ ก็ไม่มีขอบเขตของ constant นั้น ๆ ระบุ</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*SeC9HgkFzQM-vmRk.png" /></figure><p>การสร้าง global constant ต้องใช้ static let โดยการประกาศเป็น let จะทำให้ไม่สามารถแก้ไขค่าได้ใน compile time</p><p><strong>แนะนำ</strong></p><pre>enum Math {</pre><pre>  static let e = 2.718281828459045235360287<br>  static let root2 = 1.41421356237309504880168872<br>}</pre><pre>let hypotenuse = side * Math.root2</pre><p>ต้องอยู่ใน enum ที่ไม่มี case เพราะว่าถ้ามี case อาจจะสร้าง instant ของ enum นั้น ๆ ได้</p><p><strong>ไม่แนะนำ</strong></p><pre>let e = 2.718281828459045235360287 // ขยะใน global namespace<br>let root2 = 1.41421356237309504880168872<br><br>let hypotenuse = side * root2 // อะไรคือ root2 ?</pre><h4><strong>การตั้งชื่อค่าคงที่</strong></h4><p>ในภาษาอื่น ๆ เช่น Java จะใช้ snake case all capitals แต่ใน Swift จะใช้ camel case และเลิกใช้ prefix แบบใน Objective-C แต่ให้ไปอยู่ใน enum เพื่อบอก scope แทน</p><h4><strong>อ้างอิง:</strong></h4><ul><li><a href="https://github.com/raywenderlich/swift-style-guide#constants">https://github.com/raywenderlich/swift-style-guide#constants</a></li><li><a href="https://google.github.io/swift/#global-constants">https://google.github.io/swift/#global-constants</a></li><li><a href="https://swift.org/documentation/api-design-guidelines/">https://swift.org/documentation/api-design-guidelines/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=587a3a96270e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gucodelive/%E0%B8%84%E0%B9%88%E0%B8%B2%E0%B8%84%E0%B8%87%E0%B8%97%E0%B8%B5%E0%B9%88-constant-%E0%B9%83%E0%B8%99%E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B2-swift-587a3a96270e">ค่าคงที่ (constant) ในภาษา Swift</a> was originally published in <a href="https://medium.com/gucodelive">กูโค้ด</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[การยืนยันตัวตนหลายปัจจัย]]></title>
            <link>https://medium.com/gucodelive/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%A2%E0%B8%B7%E0%B8%99%E0%B8%A2%E0%B8%B1%E0%B8%99%E0%B8%95%E0%B8%B1%E0%B8%A7%E0%B8%95%E0%B8%99%E0%B8%AB%E0%B8%A5%E0%B8%B2%E0%B8%A2%E0%B8%9B%E0%B8%B1%E0%B8%88%E0%B8%88%E0%B8%B1%E0%B8%A2-409826d8f288?source=rss-98dd8ab123b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/409826d8f288</guid>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[multi-factor-auth]]></category>
            <category><![CDATA[two-factor-authentication]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[nist]]></category>
            <dc:creator><![CDATA[Wasith T. (Bai-Phai)]]></dc:creator>
            <pubDate>Tue, 05 Nov 2019 07:42:25 GMT</pubDate>
            <atom:updated>2019-11-05T08:11:54.048Z</atom:updated>
            <content:encoded><![CDATA[<p>หรือที่เรียกว่า multi-factor authentication มีรูปแบบใดบ้างไปดูกัน</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M72wBOBS7wX8okivJYYakg.png" /></figure><h4>อะไรที่คุณรู้ (Knowledge factors, aka. Something you know)</h4><p>Knowledge factor ถูกใช้ทั่วไปในในการยืนยันตัวตน โดยจะต้องระบุรหัสลับให้ได้ เช่น username, password, pincode, passcode</p><p>โดย knowledge factor รวมไปถึงชุดคำถาม และคำตอบด้วย และอาจจะไม่ปลอดถัยเช่น สถานที่เกิดของคุณ ซึ่งอาจจะมีหลายคนที่รู้ หรือสามารถสืบหาได้</p><p>หรืออาจจะเป็นคำถามที่เราจำไม่ได้ เช่น คุณสมัครใช้บริการนี้เมื่อไหร่ ? เราอาจจะจำไม่ได้ และไม่ได้จดไว้ด้วย</p><h4>อะไรที่คุณมี (Possession factors, aka. Something you have)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*BfgO0KdMFKgUcn8jAT9S6g.png" /></figure><p>ซึ่งถูกนำมาใช้ในการยืนยันตัวตนเหมือนกันเช่นบัตร ATM, SIM card หรือ security token ซึ่งมักถูกนำมาใช้ควบคู่กับวิธีการแรก โดยแบ่งได้เป็น 3 ประเภท คือ</p><ul><li><strong>Disconnected token</strong> โดย token ชนิดนี้จะไม่เชื่อต่อกับอุปกรณ์ใด ๆ เลย อาจจะมีหน้าจอแสดงตัวเลข ที่ผู้ใช้งานจะต้องกรอกเข้าระบบด้วยตัวเอง</li><li><strong>Connected token</strong> โดย token ชนิดนี้จะต้องเชื่อมต่อกับตัวระบบ โดยอาจจะผ่านสัมผัส หรือการเชื่อต่อ USB ก็ได้ บัตรแตะเข้าตึกก็อยู่ในประเภทนี้</li><li><strong>Software token</strong> จะคล้ายกับ disconnected token แต่ อยู่ในรูปของ software แต่ต่างกันตรงแบบ hardware นั้น จะไม่สามารถทำซ้ำได้ แต่แบบ software นั้น สามารถส่งวิธีการสร้างรหัสลับไปไว้ที่เครื่องอื่น ๆ ได้ด้วย เช่นเก็บไว้ใน Google Authenticator, 1Password, Authy</li></ul><h4>อะไรที่คุณเป็น (Inherent factor, aka. Something you are)</h4><p>ปัจจัย ของอะไรที่คุณเป็นนั้น มักจะเป็นการตรวจพิสูจน์บุคคล (biometrics) เช่นลายนิ้วมือ ลายมือ ใบหน้า เสียง ม่านตา DNA</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F12OIWdzFhisgww%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F12OIWdzFhisgww%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F12OIWdzFhisgww%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/fcec0fefef1d6d51605505a5e0cac4a4/href">https://medium.com/media/fcec0fefef1d6d51605505a5e0cac4a4/href</a></iframe><h4>อะไรที่คุณทำ (Behavioural factor, aka. Something you do)</h4><p>ซึ่งบางสำนักอาจจะรวมกับแบบก่อนหน้า แบบผมขอแยกออกมาดีกว่า อะไรที่คุณทำเช่น</p><ul><li>วิธีการในการพิมพ์รหัสผ่านของคุณ เช่น พิมพ์เร็ว พิมพ์ช้าแค่ไหน ระยะเวลาการพิมพ์แต่ละตัวอักษร ห่างกันแค่ไหน หรือมักพิมพ์ตัวไหนผิด</li><li>หากพิมพ์รหัสผ่านบนอุปกรณ์พกพา จะถือสองมือหรือมือเดียว โดยอาจสอดคล้องกับข้อก่อนหน้า</li><li>ลืมตาหรือป่าว มองกล้องหรือป่าว ถ้าปลดล็อคด้วยใบหน้า</li><li>วิธีการที่คุณเขย่าเมาส์เพื่อให้คอมพิวเตอร์ตื่น ก่อนจะแสดงหน้าพิมพ์รหัสผ่าน</li></ul><h4>สถานที่ที่คุณอยู่​ (Location factor, aka. Somewhere you are)</h4><p>ตามนั้นแหละ ตอนนั้นคุณที่อยู่ที่ไหน เช่นถ้าคุณทำงาน แล้วจะเข้าถึงข้อมูลที่ทำงานอยู่ได้คุณต้องนั่งอยู่ในออฟฟิศ และเชื่อมต่อเครือข่ายของบริษัทอยู่</p><p>หรือการที่คุณใช้บริการ แล้วบริการนั้นตรวจสอบ IP Address แล้วพบว่าไม่ได้อยู่ในพื้นที่ให้บริการ และคุณต้อง VPN เพื่อไปยังประเทศที่มีการให้ใช้งาน</p><p>สถานที่สามารถพัฒนาไปถึงระบบความปลอดภัยได้ เช่นปกติคุณใช้บัญชีในประเทศไทย แล้วอยู่ดี ๆ ไม่กี่นาทีถัดมาถูกพบว่าคุณ login มาจากญี่ปุ่น แปลว่าคุณโดนขโมยรหัสแล้วก็ได้</p><h4>พอมาใช้รวม ๆ กันแล้ว เลยเรียกว่า</h4><p>Multi-factor authentication หรือ two-factor authentication เช่นเมื่อ login แล้วต้องกรอก OTP อีกรอบหนึ่ง</p><p>โดยบริการโดยทั่วไปเช่น Gmail, Facebook, GitLab ก็มีให้ตั้งค่า two-factor authentication เพื่อป้องกันการเข้าถึงที่ไม่พึงประสงค์ได้</p><h4><strong>Out-Of-Band (OOB)</strong></h4><p>คือการที่ใช้อุปกรณ์ในการยืนยันตัวในหมวดใด ๆ จะต้องเป็นอุปกรณ์คนละชิ้นกับอีกหมวด</p><p>เช่น OTP คือการรับข้อความสั้นผ่าน SMS แล้วคุณมีมือถืออยู่ในมือ (Something you have) และคุณใช้มือถือนั้นในการจำรหัสผ่านด้วย (Something you know) ซึ่งควรจะเป็นคนละเครื่องกัน</p><h4>มาตรฐานที่ตกรุ่น</h4><p>National Institute of Standards and Technology (NIST) ได้ออกมาบอกว่าการใช้รหัสผ่าน SMS หรือการโทรหา<a href="https://www.blognone.com/node/93450">ถูกจัดเป็น out-of-band (OOB)</a> และอยู่ในหมวดจำกัดการใช้งาน (RESTRICTED) คือต้องมีทางเลือกอื่นในการใช้งาน ต้องแจ้งเตือนว่ามีความเสี่ยงในการใช้งาน และแนะนำทางเลือกอื่น และ OOB ด้วย และการรับ OTP ด้วย email ไม่ถูกรองรับในมาตรฐานล่าสุด</p><h4>สรุป</h4><p>ในการให้บริการใด ๆ ควรมีวิธีการยืนยันตัวตนมากกว่าแค่กรอก username, password แต่ควรใช้วิธีการอื่น ๆ ใช้ควบคู่ไปด้วย และแนะนำให้ผู้ใช้งานทำการตั้งค่าเพื่อใช้งานให้เรียบร้อย</p><p>และผู้ใช้งานควรจะต้องใช้งาน multi-factor authentication หากบริการนั้น ๆ มีให้ใช้ เพราะจะปลอดภัยกว่าการกรอกรหัสผ่านเพียงอย่างเดียว</p><p>สวัสดีครับ</p><p><strong>อ้างอิง</strong></p><ul><li><a href="https://medium.com/@renansdias/the-5-factors-of-authentication-bcb79d354c13">https://medium.com/@renansdias/the-5-factors-of-authentication-bcb79d354c13</a></li><li><a href="https://en.wikipedia.org/wiki/Multi-factor_authentication">https://en.wikipedia.org/wiki/Multi-factor_authentication</a></li><li>https://en.wikipedia.org/wiki/Keystroke_dynamics</li><li><a href="https://pages.nist.gov/800-63-3/">https://pages.nist.gov/800-63-3/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=409826d8f288" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gucodelive/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%A2%E0%B8%B7%E0%B8%99%E0%B8%A2%E0%B8%B1%E0%B8%99%E0%B8%95%E0%B8%B1%E0%B8%A7%E0%B8%95%E0%B8%99%E0%B8%AB%E0%B8%A5%E0%B8%B2%E0%B8%A2%E0%B8%9B%E0%B8%B1%E0%B8%88%E0%B8%88%E0%B8%B1%E0%B8%A2-409826d8f288">การยืนยันตัวตนหลายปัจจัย</a> was originally published in <a href="https://medium.com/gucodelive">กูโค้ด</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UX/UI ว่าด้วย number keypad กับตัวหนังสือที่หายไป]]></title>
            <link>https://medium.com/gucodelive/ux-ui-%E0%B8%A7%E0%B9%88%E0%B8%B2%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-number-keypad-%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%95%E0%B8%B1%E0%B8%A7%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%AB%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%9B-c67eb706ef22?source=rss-98dd8ab123b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/c67eb706ef22</guid>
            <category><![CDATA[numberpad]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[keypad]]></category>
            <category><![CDATA[custom-keyboard]]></category>
            <dc:creator><![CDATA[Wasith T. (Bai-Phai)]]></dc:creator>
            <pubDate>Sun, 03 Nov 2019 10:52:56 GMT</pubDate>
            <atom:updated>2019-11-03T11:49:09.299Z</atom:updated>
            <content:encoded><![CDATA[<h3>UX/UI ว่าด้วย number pad กับตัวอักษรที่หายไป</h3><p>เราเคยสังเกตมั้ยว่า บนแป้นโทรศัพท์ หรือหน้าจอกรอก pin code เพื่อเข้าโทรศัพท์จะมีตัวหนังสือประกอบด้วย นอกเหนือจากตัวเลข</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tBSY15qZyzDldi8CglODHg.png" /><figcaption>หน้าจำลองปลดลอคโทรศัพท์ iPhone และหน้ากรอก pin แอป SCB Easy</figcaption></figure><p>จริง ๆ แล้วมันสามารถใช้ประโยชน์ได้ เช่น แทนที่เราจะจำเป็นตัวเลข เราจำเป็นคำพูดหรือประโยคแทน เช่นเบอร์โทรศัพท์ call-center ของแอปเปิลฝั่ง US จะเขียนว่า 1–800-MY-APPLE แทน 1–800–69–27753 ถาม แล้วเรารู้ได้อย่างไรว่า MY-APPLE คือ 69-27753</p><p>ดูตามรูป เราจะเห็นว่าตัวอักษรอยู่ในวงกลมตัวไหนก็กดได้เลย ซึ่งวิธีการนี้มีมาตั้งแต่ก่อน smartphone จะเกิด แต่ก็ยังมีการใช้งานกันอยู่ เราเลยจะเห็นตัวหนังสือพวกนี้ตามหน้ากรอก passcode หน้า phone dial</p><p>ถ้าถามว่ามีใครใช้บาง อย่างน้อยผมก็เห็นพี่ชายผมคนนึงแหละ ใช้ประมาณว่า 081-I-AM-PHAI (เบอร์สมมุติ) และเราสามารถบันทึกด้วยตัวหนังสือแบบนี้ลงไปใส่สมุดโทรศัพท์แล้วสามารถโทรได้จริง ลองดูได้ 🥳</p><p>แต่พอคนไทยนำมาใช้งานกับแอปแล้ว custom ตัว number pad นี้ ก็ตัดตัวหนังสือออกซะงั้น บางเจ้าไม่ทำ state ตอนกดปุ่มให้สี กรอบ หรือตำแหน่งเปลี่ยนด้วย (touch feedback) ให้ความรู้สึกเหมือนแอปค้างแทน</p><p>ได้โปรดเอากลับมาเถอะครับ ถ้าใครจะ custom number pad ถ้าทำได้ไม่ดีก็ใช้ของเครื่องก่อนก็ได้</p><p><strong>สวัสดีครับ</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c67eb706ef22" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gucodelive/ux-ui-%E0%B8%A7%E0%B9%88%E0%B8%B2%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-number-keypad-%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%95%E0%B8%B1%E0%B8%A7%E0%B8%AB%E0%B8%99%E0%B8%B1%E0%B8%87%E0%B8%AA%E0%B8%B7%E0%B8%AD%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%AB%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%9B-c67eb706ef22">UX/UI ว่าด้วย number keypad กับตัวหนังสือที่หายไป</a> was originally published in <a href="https://medium.com/gucodelive">กูโค้ด</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS ตรวจสอบว่า เราต่อ 4G หรือ WiFi และดูว่าต่อ 4G เจ้าไหนอยู่]]></title>
            <link>https://medium.com/gucodelive/ios-%E0%B8%95%E0%B8%A3%E0%B8%A7%E0%B8%88%E0%B8%AA%E0%B8%AD%E0%B8%9A%E0%B8%A7%E0%B9%88%E0%B8%B2-%E0%B9%80%E0%B8%A3%E0%B8%B2%E0%B8%95%E0%B9%88%E0%B8%AD-4g-%E0%B8%AB%E0%B8%A3%E0%B8%B7%E0%B8%AD-wifi-%E0%B9%81%E0%B8%A5%E0%B8%B0%E0%B8%94%E0%B8%B9%E0%B8%A7%E0%B9%88%E0%B8%B2%E0%B8%95%E0%B9%88%E0%B8%AD-4g-%E0%B9%80%E0%B8%88%E0%B9%89%E0%B8%B2%E0%B9%84%E0%B8%AB%E0%B8%99%E0%B8%AD%E0%B8%A2%E0%B8%B9%E0%B9%88-1aa3e5bbbef5?source=rss-98dd8ab123b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/1aa3e5bbbef5</guid>
            <category><![CDATA[carrier]]></category>
            <category><![CDATA[wifi]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[network]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Wasith T. (Bai-Phai)]]></dc:creator>
            <pubDate>Sun, 03 Nov 2019 07:35:50 GMT</pubDate>
            <atom:updated>2019-11-03T07:36:58.405Z</atom:updated>
            <content:encoded><![CDATA[<p>ใช่ครับเราสามารถดูได้คร่าว ๆ ว่าต่อ WiFi หรือ cellular อยู่หรือป่าว แต่เราบอกไม่ได้ 100% นะว่าเครื่องจะใช้ WiFi หรือใช้ cellular เพราะเป็น OS ที่จัดการ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*fsKXRoT7iBMusuHUCbQabw.png" /></figure><h4>ไปที่โค้ดเชค WiFi กันเลย</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d170764640692eb591de905572f462b/href">https://medium.com/media/1d170764640692eb591de905572f462b/href</a></iframe><p>โดยโค้ดของ Reachability สามารถไปดูได้ที่ <a href="https://developer.apple.com/library/archive/samplecode/Reachability/Introduction/Intro.html">https://developer.apple.com/library/archive/samplecode/Reachability/Introduction/Intro.html</a></p><p>อย่าลืม#import &quot;Reachability.h&quot; ใน Bridging Header นะครับ</p><p>หรือเราสามารถใช้ Reachaility ตัวอื่นก็ได้ มีให้ใช้เยอะพอสมควร</p><h4><strong>และเราสามารถดูได้ด้วยว่าต่อด้วย 2G, 3G หรือ 4G</strong></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff7f0c104eb8e0c15d1b6ab29194dfd7/href">https://medium.com/media/ff7f0c104eb8e0c15d1b6ab29194dfd7/href</a></iframe><h4>แล้วถ้าจะดูว่าต่อผู้ให้บริการโทรศัพท์เคลื่อนที่เจ้าไหน</h4><p>สำหรับ code ชุดแรกเป็นของ iOS ต่ำกว่า 12</p><p>โดยเท่าที่ทดสอบ ประเทศไทยจะได้รหัส 520</p><p>และทดสอบกับแต่ละ sim card ได้ MobileNetworkCode ตามนี้</p><ul><li>TruemoveH รายเดือน: 00</li><li>Sim2Fly: 03</li><li>dtac รายเดือน: 05</li></ul><p>ถึงแม้ว่าภายนอกเราอาจจะมองว่าเป็นเจ้าเดียวกันเช่น Orange, Truemove, TruemoveH หรือ dtac, dtac TriNet, Line Mobile ก็อาจจะได้เลข MobileNetworkCode ตัวเดียวกันหรือคนละตัวก็ได้ ต้องไปทดสอบกัน หรือสอบถามไปยัง operator</p><p>สำหรับ iOS ต่ำกว่า 12 ดู code ชุดนี้ได้เลย</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a787ef2e333475ec090144e4b64d1304/href">https://medium.com/media/a787ef2e333475ec090144e4b64d1304/href</a></iframe><p>สำหรับ iOS 12 ขึ้นไป iPhone เริ่มรองรับ 2 sim cards แล้วทำให้ api เปลี่ยนไป โดยสามารถใช้งานได้ผ่าน CTTelephonyNetworkInfo().serviceSubscriberCellularProviders ซึ่งมีหน้าตาประมาณนี้</p><pre>[&quot;0000000100000001&quot;: CTCarrier (0x2801f26d0) {<br>  Carrier name: [TRUE-H]<br>  Mobile Country Code: [520]<br>  Mobile Network Code:[00]<br>  ISO Country Code:[th]<br>  Allows VOIP? [YES]<br>}]</pre><p>ถ้าผมใช้เป็นแล้วเดี๋ยวค่อยมา update นะครับ</p><p>สวัสดีครับ</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1aa3e5bbbef5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gucodelive/ios-%E0%B8%95%E0%B8%A3%E0%B8%A7%E0%B8%88%E0%B8%AA%E0%B8%AD%E0%B8%9A%E0%B8%A7%E0%B9%88%E0%B8%B2-%E0%B9%80%E0%B8%A3%E0%B8%B2%E0%B8%95%E0%B9%88%E0%B8%AD-4g-%E0%B8%AB%E0%B8%A3%E0%B8%B7%E0%B8%AD-wifi-%E0%B9%81%E0%B8%A5%E0%B8%B0%E0%B8%94%E0%B8%B9%E0%B8%A7%E0%B9%88%E0%B8%B2%E0%B8%95%E0%B9%88%E0%B8%AD-4g-%E0%B9%80%E0%B8%88%E0%B9%89%E0%B8%B2%E0%B9%84%E0%B8%AB%E0%B8%99%E0%B8%AD%E0%B8%A2%E0%B8%B9%E0%B9%88-1aa3e5bbbef5">iOS ตรวจสอบว่า เราต่อ 4G หรือ WiFi และดูว่าต่อ 4G เจ้าไหนอยู่</a> was originally published in <a href="https://medium.com/gucodelive">กูโค้ด</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ใช้ 4G ในการยืนยันเบอร์ผู้ใช้งาน ปลอดภัยจริงหรือ ?]]></title>
            <link>https://medium.com/gucodelive/%E0%B9%83%E0%B8%8A%E0%B9%89-4g-%E0%B9%83%E0%B8%99%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%A2%E0%B8%B7%E0%B8%99%E0%B8%A2%E0%B8%B1%E0%B8%99%E0%B9%80%E0%B8%9A%E0%B8%AD%E0%B8%A3%E0%B9%8C%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B9%83%E0%B8%8A%E0%B9%89%E0%B8%87%E0%B8%B2%E0%B8%99-%E0%B8%9B%E0%B8%A5%E0%B8%AD%E0%B8%94%E0%B8%A0%E0%B8%B1%E0%B8%A2%E0%B8%88%E0%B8%A3%E0%B8%B4%E0%B8%87%E0%B8%AB%E0%B8%A3%E0%B8%B7%E0%B8%AD-64459870153f?source=rss-98dd8ab123b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/64459870153f</guid>
            <category><![CDATA[hijack]]></category>
            <category><![CDATA[msisdn]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Wasith T. (Bai-Phai)]]></dc:creator>
            <pubDate>Sun, 03 Nov 2019 05:46:26 GMT</pubDate>
            <atom:updated>2019-11-06T02:14:13.190Z</atom:updated>
            <content:encoded><![CDATA[<h3>ใช้ 4G ในการยืนยันเบอร์ผู้ใช้งาน ปลอดภัยจริงหรือ ?</h3><p>จะเห็นได้ว่ามีผู้ให้บริการแอปบางราย บังคับให้เราใช้เบอร์โทรศัพท์เคลื่อนที่เพื่อยืนยันตัวตน ก่อนจะไปดูกันว่าปลอดภัยหรือไม่ ไปดูกันก่อนว่ามันทำงานอย่างไร</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*poIcYg6A2OKFNJy34Y_Tkw.png" /><figcaption><strong><em>Icon made by </em></strong><a href="https://www.freepik.com/home"><strong><em>Freepik</em></strong></a><strong><em>, </em></strong><a href="https://www.flaticon.com/authors/smashicons"><strong><em>Smashicons</em></strong></a><strong><em>, </em></strong><a href="https://www.flaticon.com/authors/vectors-market"><strong><em>Vectors Market</em></strong></a><strong><em> from </em></strong><a href="http://www.flaticon.com/"><em>www.flaticon.com</em></a></figcaption></figure><p>ซึ่งกระบวนการที่จะเพิ่มข้อมูลเข้าในจะต้องเป็น http protocol ซึ่งไม่มีการเข้ารหัส และการไม่ถูกเข้ารหัสนี้สามารถทำให้คนที่อยู่ระหว่างทางสามารถที่จะปลอมแปลง request และ response ได้</p><ul><li>ต่อไปนี้จะเรียก ผู้ให้บริการโทรศัพท์เคลื่อนที่ว่า “operator”</li></ul><p>ตัวอย่าง http request ออกจากมือถือคือ</p><pre>GET /what-is-my-phone-number HTTP/1.1<br>Host: api.someservice.co.th<br>User-Agent: myCustomHTTPClient/0.0.1<br>Accept: */*</pre><p>และ operator ทำการตรวจสอบแล้วว่า request ที่ส่งมาถูกต้อง เช่นอาจจะตรวจอบแค่ host และ path ทาง operator จะทำการแปะเบอร์มาให้ พอขาออกจาก operator จะเพิ่ม header ตัวนึงที่อาจแตกต่างกันออกไปในแต่ผู้ให้บริการ เช่น</p><ul><li>X-UP-CALLING-LINE-ID</li><li>X-NOKIA-MSISDN</li><li>X-MSISDN</li></ul><p>เมื่อ request นั้นถึงทางระบบของผู้ให้บริการแอป ทางก็จะได้รับว่า request นั้นเป็น</p><pre>GET /what-is-my-phone-number HTTP/1.1<br>Host: api.someservice.co.th<br>User-Agent: myCustomHTTPClient/0.0.1<br>Accept: */*<br>X-Nokia-msisdn: 66812345678</pre><p>สังเกตุว่า request เปลี่ยนไป มี header ที่ชื่อว่า X-Nokia-msisdn เพิ่มเข้ามา ตรงนี้ ระบบของแอปก็จะแกะจาก header ที่ได้ตกลงกันไว้ ก็จะทราบได้ว่าเบอร์เป็นเบอร์ 66812345678 หรือที่บ้านเราเรียก 081-234-5678 นั่นเอง</p><h4>แล้ววิธีการนี้ใช้ยืนยันตัวได้อย่างไร</h4><ul><li>เมื่อโทรศัพท์และ SIM เราทำการยืนยันตัวตนกับสถานีฐานของโครงข่ายแล้ว ทางโครงข่ายจะรู้จักเราทันที</li><li>ของจากตัวผู้ให้บริการโครงข่ายแล้ว ไม่ควรจะมีใครเข้าไป เปลี่ยนแปลงแก้ไขข้อมูลได้</li><li>ถ้าเราอยากปลอมเป็นเบอร์ใด ๆ ก็ตามต้องมี SIM นั้น ๆ อยู่ในมือ เพราะการปลอม SIM ยากมาก</li></ul><h4><strong>จากเอกสารในงาน DefCamp 2012 ได้รายงานว่า</strong></h4><ul><li>ช่องโหว่นี้ถูกค้นพบใน มกราคม 2012</li><li>รายงานแรกถูกแจ้งไปยัง operators ต่าง ๆ ในโซนยุโรปในเดือนมีนาคม</li><li>มีการรายงานไป GSMA ในเดือนเมษา หลังจากได้รับการยืนยันจากผู้ให้บริการ</li><li>operators ทำการปิดช่องโหว่ภายหลังไม่นาน</li><li>operators ส่วนใหญ่ได้ทำการปิดช่องโหว่นี้เรียบร้อยแล้ว เหลือแต่ 3rd party ที่ใช้ระบบนี้ และยังพัฒนาได้ไม่ดีพอ</li></ul><h4>แก้ปัญหาอย่างไร ไม่ช่วยให้ความปลอดภัยมากขึ้น</h4><ul><li>ใช้ HTTP POST เพื่อส่งข้อมูลใน body แทน header</li><li>ตรวจสอบ header, body เพิ่มเติม เพราะผู้ไม่หวังดีก็สามารถดักจับและลองเลียนได้ไม่ยาก</li><li>ไม่ตอบอะไรกลับมาที่แอป แต่ทำให้แอปต้องส่งเลขบางอย่างไปแทน เช่นเลข token ซึ่ง token นี้เองอาจไม่ได้ระวัง เพราะใช้เป็นเลขเดียวกับตอนที่วิ่งผ่าน HTTPS ซึ่งเข้ารหัส อาจทำให้โดนขโมย token ระหว่างทางได้ (session hijack)</li></ul><h4><strong>คำแนะนำ</strong></h4><ul><li>อย่าเชื่อเบอร์ที่มาจาก header</li><li>สร้าง token มาอีกตัวหนึ่งเพื่อใช้กับ api endpoint นี้โดยเฉพาะ และรู้กับระหว่าง แอป และ ระบบใน session นั้น ๆ ด้วย</li><li>หรือถ้าตกลงกับ operator ได้มากเราจะตกลงวิธีการ handshake แบบพิเศษอื่น ๆ เพิ่มเติมได้ เช่นให้จัดทำ api ที่เป็น https ให้ หรือทำการ request ไปที่ operator แล้วรับ token กลับมาที่แอป แล้วให้แอปยิงไปหา api ของเรา แล้ว api ของเราเอา token ไปตรวจสอบกับ operator อีกรอบ ซึ่ง api ของเราต้องทำการ authen กับ operator อย่างถูกต้อง</li><li>เพื่อให้ดักข้อมูลได้ยากขึ้น ให้แอปทำการ<a href="https://medium.com/@phai/1aa3e5bbbef5">ตรวจสอบก่อนว่าได้ทำการเชื่อมต่อเครือข่ายโทรศัพท์แล้ว และไม่ได้เชื่อมต่อ WiFi</a> จึงยิง api ตรวจสอบเบอร์</li><li>เชื่อมต่อตรงกับผู้ให้บริการ เพื่อไม่ให้มีการดัก หรือแก้ไขข้อมูลระหว่างทาง</li><li>ตรวจสอบว่ามีการดีบัคโทรศัพท์ หรือแอปอยู่หรือไม่ เพื่อป้องกันการดูพฤติกรรมแอป ถ้าใช่อาจจะแสดงข้อความเตือน หรือปิดแอปในทันที</li><li>ทำการ obfuscate ตัวโค้ด เพื่อให้ยากแก่การ reverse engineer</li></ul><h4>อ่านเพิ่มเติม</h4><p>บทความเดิม <a href="https://medium.com/@phai/d76919ac6d0f"><strong>ยอมให้ iOS แอปใช้งาน http ได้ แบบเจาะจงโดนเมน หรือยอมให้ใช้วิธีการเข้ารหัสแบบเก่า</strong></a><strong> </strong>ซึ่งได้แนะนำวิธีการเปิดใช้ http แบบที่ปลอดภัยมากขึ้นด้วย</p><p><a href="https://medium.com/gucodelive/%E0%B8%A2%E0%B8%AD%E0%B8%A1%E0%B9%83%E0%B8%AB%E0%B9%89-ios-%E0%B9%81%E0%B8%AD%E0%B8%9B%E0%B9%83%E0%B8%8A%E0%B9%89%E0%B8%87%E0%B8%B2%E0%B8%99-http-%E0%B9%84%E0%B8%94%E0%B9%89-%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B9%80%E0%B8%88%E0%B8%B2%E0%B8%B0%E0%B8%88%E0%B8%87%E0%B9%82%E0%B8%94%E0%B8%99%E0%B9%80%E0%B8%A1%E0%B8%99-%E0%B8%AB%E0%B8%A3%E0%B8%B7%E0%B8%AD%E0%B8%A2%E0%B8%AD%E0%B8%A1%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B9%83%E0%B8%8A%E0%B9%89%E0%B8%A7%E0%B8%B4%E0%B8%98%E0%B8%B5%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B9%80%E0%B8%81%E0%B9%88%E0%B8%B2-d76919ac6d0f">ยอมให้ iOS แอปใช้งาน http ได้ แบบเจาะจงโดนเมน หรือยอมให้ใช้วิธีการเข้ารหัสแบบเก่า</a></p><p>และ<a href="https://medium.com/@phai/ffa425a20f40"><strong>การทำ certificates pinning กับ Alamofire</strong></a> แบบที่ผู้ไม่ประสงค์ดีจะแกะยากขึ้นนิดหน่อย (มั้ง)</p><p><a href="https://medium.com/gucodelive/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%97%E0%B8%B3-certificates-pinning-%E0%B8%81%E0%B8%B1%E0%B8%9A-alamofire-ffa425a20f40">การทำ certificates pinning กับ alamofire</a></p><p>ถ้าใครอยู่กับ codebase หรือวิธีการแบบที่กล่าวมา ก็ให้ลองเชคกันดูครับว่า ที่ทำกันอยู่ยังปลอดภัยอยู่หรือ ไม่ หรือมีวิธีการที่ดีกว่าแล้ว</p><p>ถ้าใครมีข้อแนะนำเพิ่มเติม บอกได้เลยนะครับ จะขอบพระคุณมาก</p><p>อ้างอิง <a href="https://vimeo.com/54783329">Vimeo</a>, <a href="https://www.slideshare.net/DefCamp/mobile-networks-exploiting-http-headers-and-data-traffic">SlideShare</a>, <a href="http://www.mulliner.org/collin/academic/publications/mobile_web_privacy_icin10_mulliner.pdf">Mulliner</a>, <a href="https://github.com/vovimayhem/mobile-subscriber-gem">Github</a></p><p><strong>สวัสดีครับ</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64459870153f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gucodelive/%E0%B9%83%E0%B8%8A%E0%B9%89-4g-%E0%B9%83%E0%B8%99%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%A2%E0%B8%B7%E0%B8%99%E0%B8%A2%E0%B8%B1%E0%B8%99%E0%B9%80%E0%B8%9A%E0%B8%AD%E0%B8%A3%E0%B9%8C%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B9%83%E0%B8%8A%E0%B9%89%E0%B8%87%E0%B8%B2%E0%B8%99-%E0%B8%9B%E0%B8%A5%E0%B8%AD%E0%B8%94%E0%B8%A0%E0%B8%B1%E0%B8%A2%E0%B8%88%E0%B8%A3%E0%B8%B4%E0%B8%87%E0%B8%AB%E0%B8%A3%E0%B8%B7%E0%B8%AD-64459870153f">ใช้ 4G ในการยืนยันเบอร์ผู้ใช้งาน ปลอดภัยจริงหรือ ?</a> was originally published in <a href="https://medium.com/gucodelive">กูโค้ด</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>