Merge changes from topic "v1_impl_cherrypick" into main

* changes:
  [nearby] Update encoding and decoding according to the spec
  [nearby] Update encryption methods according to the spec